CustomerObject
Contains customer data.
Description
This object contains all relevant customer data including the CustNum (a unique customer number assigned by the gateway), CustID (a merchant assigned customer ID), as well as customer name, address, recurring billing status and schedule, and any other relevant data.
Properties
Type | Name | Description |
---|---|---|
string | CustNum | Customer Number (System assigned) |
string | CustKey | Customer Number (System assigned) |
string | CustomerID | Customer ID (Merchant Assigned) |
Address | BillingAddress | Customer Address information. (Uses Address object.) |
PaymentMethod | PaymentMethods | Array of PaymentMethod objects. Multiple credit cards or ACH accounts may be stored for each |
string | Notes | Notes (visible to merchant only). |
string | CustomData | Custom data is a raw text field, please serialize and encode (ie: base64) your data so that complex types are stored and retrieved correctly. |
FieldValue | CustomFields | Array of field values containing the merchant defined customer fields. These fields are defined in the merchant console. |
string | URL | URL for customers website |
datetime | Created | Date/Time customer was created (Read Only) |
datetime | Modified | Date/Time customer was last changed (Read Only) |
Recurring Billing | ||
boolean | Enabled | Notes whether or not a customer has been enabled for a recurring billing cycle. The customer billing does not need to be enabled to run one time transactions via the runCustomerTransaction method. |
string | Schedule | Recurring billing schedule, if any. Possible values include: daily, weekly, bi-weekly (every two weeks), monthly, bi-monthly (every two months), quarterly, bi-annually (every six months), annually, first of month, last day of month. |
integer | NumLeft | Number of transactions remaining in customer's recurring billing cycle. "-1" indicates unlimited transactions. |
string | Next | Date of customer's next scheduled transaction. |
double | Amount | Total Amount to be billed in recurring billing cycle. |
double | Tax | Portion of "Amount" that is Tax |
string | Currency | Numeric currency code for Amount. (Only needed if multicurrency merchant account) |
string | Description | Description of transaction. |
string | OrderID | Transaction Order ID |
string | User | Merchant username assigned to billing. |
string | Source | Name of source key assigned to billing. |
boolean | SendReceipt | Send client a receipt. |
string | ReceiptNote | Note to send on receipt. |
int | Failures | Number of failures since last approval. |
Point of Sale | ||
string | PriceTier | Name of customer price tier |
string | TaxClass | Tax Class (Group) |
string | LookupCode | Lookup code from customer/member id card. Either barcode or Magnetic stripe. Can be assigned by merchants. Defaults to system assigned if left blank. |
Places Used
Examples
PHP
<?php
// for directions on how to set up the
// WSDL link and create "$token" and "$client,"
// see: [http://help.newtekgateway.com/developer/soap-api/howto/php/](http://help.newtekgateway.com/developer/soap-api/howto/php/)
$CustomerObject=array(
'BillingAddress'=>array(
'FirstName'=>'John',
'LastName'=>'Doe',
'Company'=>'Acme Corp',
'Street'=>'1234 main st',
'Street2'=>'Suite #123',
'City'=>'Los Angeles',
'State'=>'CA',
'Zip'=>'12345',
'Country'=>'US',
'Email'=>'support@newtekgateway.com',
'Phone'=>'333-333-3333',
'Fax'=>'333-333-3334'
),
'PaymentMethods' =>
array(
array(
'CardNumber'=>'4444555566667779',
'CardExpiration'=>'0918',
'CardType'=>'',
'CardCode'=>'',
'AvsStreet'=>'',
'AvsZip'=>'',
'CardPresent'=>'',
'MagStripe'=>'',
'TermType'=>'',
'MagSupport'=>'',
'XID'=>'',
'CAVV'=>'',
'ECI'=>'',
'InternalCardAuth'=>'',
'Pares'=>'',
"Expires"=>"",
"MethodName"=>"My Visa",
"SecondarySort"=>1
)
),
'CustomData'=>base64_encode(serialize(array("mydata"=>"We could put anything in here!"))),
'CustomFields'=>array(
array('Field'=>'Foo', 'Value'=>'Testing'),
array('Field'=>'Bar', 'Value'=>'Tested')
),
'CustomerID'=>123123 + rand(),
'Description'=>'Weekly Bill',
'Enabled'=>false,
'Amount'=>'44.93',
'Tax'=>'0',
'Next'=>'2012-01-21',
'Notes'=>'Testing the soap addCustomer Function',
'NumLeft'=>'50',
'OrderID'=>rand(),
'ReceiptNote'=>'addCustomer test Created Charge',
'Schedule'=>'weekly',
'SendReceipt'=>true,
'Source'=>'Recurring',
'CustNum'=>'C'.rand()
);
$CustomerNumber=$this->client->addCustomer($this->token,$CustomerObject);
$CustomerObject= $this->client->getCustomer($this->token, $CustomerNumber);
echo $CustomerObject->CustNum;
?>
.NET VB
Dim customer As newtek.CustomerObject = New newtek.CustomerObject
Dim address As newtek.Address = New newtek.Address
address.FirstName = "John"
address.LastName = "Doe"
address.Company = "Acme"
address.Street = "123 main st."
address.City = "Hollywood"
address.State = "ca"
address.Zip = "91607"
address.Country = "USA"
customer.BillingAddress = address
customer.Enabled = True
customer.Amount = 5.0
customer.Next = "2010-08-15"
customer.Schedule = "monthly"
Dim payMethod(0) As newtek.PaymentMethod
payMethod(0) = New newtek.PaymentMethod
payMethod(0).CardExpiration = "1212"
payMethod(0).CardNumber = "4444555566667779"
payMethod(0).AvsStreet = "123 Main st."
payMethod(0).AvsZip = "90046"
payMethod(0).MethodName = "My Visa"
customer.PaymentMethods = payMethod
.NET C
newtek.CustomerObject customer = new newtek.CustomerObject();
newtek.Address address = new newtek.Address();
address.FirstName = "John";
address.LastName = "Doe";
address.Company = "Acme";
address.Street = "123 main st.";
address.City = "Hollywood";
address.State = "ca";
address.Zip = "91607";
address.Country = "USA";
customer.BillingAddress = address;
customer.Enabled = true;
customer.Amount = 5.00;
customer.Next = "2010-08-15";
customer.Schedule = "monthly";
newtek.PaymentMethod[] payMethod = new newtek.PaymentMethod[1];
payMethod[0] = new newtek.PaymentMethod();
payMethod[0].CardExpiration = "1212";
payMethod[0].CardNumber = "4444555566667779";
payMethod[0].AvsStreet = "123 Main st.";
payMethod[0].AvsZip = "90046";
payMethod[0].MethodName = "My Visa";
customer.PaymentMethods = payMethod;
XML
<getCustomerReturn xsi:type="ns1:CustomerObject">
<Amount xsi:type="xsd:double">1.00</Amount>
<BillingAddress xsi:type="ns1:Address">
<City xsi:type="xsd:string">Los Angeles</City>
<Company xsi:type="xsd:string">UsaEpay</Company>
<Country xsi:type="xsd:string">US</Country>
<Email xsi:type="xsd:string">support@newtekgateway.com</Email>
<Fax xsi:type="xsd:string">333-333-3334</Fax>
<FirstName xsi:type="xsd:string">Example</FirstName>
<LastName xsi:type="xsd:string">Generator</LastName>
<Phone xsi:type="xsd:string">333-333-3333</Phone>
<State xsi:type="xsd:string">CA</State>
<Street xsi:type="xsd:string">1234 main st</Street>
<Street2 xsi:type="xsd:string">Suite #123</Street2>
<Zip xsi:type="xsd:string">12345</Zip>
</BillingAddress>
<CustNum xsi:type="xsd:string">21727</CustNum>
<CustomData xsi:type="xsd:string">
</CustomData>
<CustomFields SOAP-ENC:arrayType="ns1:FieldValue[2]" xsi:type="ns1:FieldValueArray">
<item xsi:type="ns1:FieldValue">
<Field xsi:type="xsd:string">Example</Field>
<Value xsi:type="xsd:string">Field</Value>
</item>
</CustomFields>
<CustomerID xsi:type="xsd:string">156244967</CustomerID>
<Created xsi:type="xsd:string">2008-05-08 13:40:35</Created>
<Description xsi:type="xsd:string">Weekly Bill</Description>
<Enabled xsi:type="xsd:boolean">false</Enabled>
<Modified xsi:type="xsd:string">2008-05-08 13:40:35</Modified>
<Next xsi:type="xsd:string">2012-01-21T12:00:00</Next>
<Notes xsi:type="xsd:string">Any notes go here</Notes>
<NumLeft xsi:type="xsd:integer">50</NumLeft>
<OrderID xsi:type="xsd:string">1707022452</OrderID>
<PaymentMethods SOAP-ENC:arrayType="ns1:PaymentMethod[1]" xsi:type="ns1:PaymentMethodArray">
<item xsi:type="ns1:PaymentMethod">
<CheckData xsi:type="ns1:CheckData">
<Account xsi:nil="true"/>
<Routing xsi:nil="true"/>
</CheckData>
<CreditCardData xsi:type="ns1:CreditCardData">
<AvsStreet xsi:type="xsd:string">1234 main st</AvsStreet>
<AvsZip xsi:type="xsd:string">12345</AvsZip>
<CardExpiration xsi:type="xsd:string">XXXX</CardExpiration>
<CardNumber xsi:type="xsd:string">XXXXXXXXXXXX7779</CardNumber>
<CardType xsi:type="xsd:string">V</CardType>
</CreditCardData>
<Expires xsi:type="xsd:string">2008-05-08</Expires>
<MethodID xsi:type="xsd:string">7353</MethodID>
<MethodName xsi:type="xsd:string">My Visa</MethodName>
<SecondarySort xsi:type="xsd:integer">1</SecondarySort>
</item>
</PaymentMethods>
<ReceiptNote xsi:type="xsd:string">Example Receipt Note</ReceiptNote>
<Schedule xsi:type="xsd:string">Weekly</Schedule>
<SendReceipt xsi:type="xsd:boolean">true</SendReceipt>
<Source xsi:type="xsd:string">Recurring</Source>
<Tax xsi:type="xsd:double">0</Tax>
<User xsi:type="xsd:string">(Auto)</User>
</getCustomerReturn>
Change Log
Version | Change |
---|---|
1.7 | Added Custkey type string |