Contains customer data.
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.
Type | Name | Description |
---|---|---|
string | CustNum | Customer Number (System assigned) |
string | CustomerID | Customer ID (Merchant assigned) |
Address | BillingAddress | Customer Address information. (Uses Address object.) |
boolean | SendReceipt | Send client a receipt. |
string | ReceiptNote | Note to send on receipt. |
string | Notes | Notes (visible to merchant only). |
PaymentMethod | PaymentMethods | Array of PaymentMethod objects. Multiple credit cards or ACH accounts may be stored for each customer. |
string | User | Merchant username assigned to billing. |
string | Source | Name of source key assigned to billing. |
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. |
string | Next | Date of customer's next scheduled transaction. |
integer | NumLeft | Number of transactions remaining in customer's recurring billing cycle. “-1” indicates unlimited transactions. |
double | Amount | Amount to be billed in recurring billing cycle. |
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 | 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 | Description | Description of transaction. |
string | OrderID | Transaction Order ID |
int | Failures | Number of failures since last approval. |
<?php // for directions on how to set up the // WSDL link and create "$token" and "$client," // see: http://wiki.usaepay.com/developer/soap/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@usaepay.com', 'Phone'=>'333-333-3333', 'Fax'=>'333-333-3334' ), 'PaymentMethods' => array( array( 'CreditCardData' => array( 'CardNumber'=>'4444555566667779', 'CardExpiration'=>'0908', '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; ?>
<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@usaepay.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:integer">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>
Version | Change |
---|---|
1.0 | Addition of CustomFields parameter, addition of Tax parameter, addition of PaymentMethods, removal of CheckData and CreditCardData parameters |