AddCustomerPaymentMethodProfile
This method allows you to add a new payment method to a customer record.
Description
This is used for multiple payment methods to be stored for each customer. There is no limit to the number of payment methods that can be stored, but only one of these methods may be marked as the default payment method for all future transactions, including recurring billing and manual charges.
All new payment methods will be validated by the system to ensure that the information entered fits the required format for the specified payment method. (I.e.: does the credit card have 16 digits and a future expiration date? Does the check routing number have 9 digits?)
This method requires the use of the customerInternalId, a unique customer Id assigned by EBizCharge.
Syntax
string AddCustomerPaymentMethodProfile(SecurityToken securityToken, string customerInternalId, PaymentMethodProfile paymentMethodProfile)
Arguments
Type | Name | Description |
---|---|---|
SecurityToken | securityToken | Merchant security token: used to identify merchant and validate transaction. (required) |
string | customerInternalId | Unique customer ID number assigned by the internal system for an existing customer. (required) |
PaymentMethodProfile | paymentMethodProfile | Includes method name, description, ID, expiration date, etc. (required) |
Return Value
Type | Description |
---|---|
string | The ID of the new payment method. |
Examples
function addCustomerPaymentMethod()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '******-454757-4567457-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$customerPayment = array(
'MethodName' => 'My Visa',
'SecondarySort' => 1,
'Created' => date('Y-m-d\TH:i:s'),
'Modified' => date('Y-m-d\TH:i:s'),
'AvsStreet' => 'St 5',
'AvsZip' => '54000',
'CardCode' => '123',
'CardExpiration' => '11/20',
'CardNumber' => '4000100011112224',
'CardType' => '90046',
'Balance' => '44',
'MaxBalance' => '50',
);
$paymentMethod = $client->addCustomerPaymentMethodProfile(
array(
'securityToken' => $securityToken,
'customerInternalId' => '4757477-45784-457487',
'paymentMethodProfile' => $customerPayment
));
$paymentMethodId = $paymentMethod->AddCustomerPaymentMethodProfileResult;
if ($paymentMethodId)
echo "Payment Method Added Sucessfully";
}
Request:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header />
<env:Body>
<AddCustomerPaymentMethodProfile xmlns="http://eBizCharge.ServiceModel.SOAP">
<securityToken>
<SecurityId>*******-c870-41b8-aa5c-********</SecurityId>
</securityToken>
<customerInternalId>*******-d1c1-4dfe-8d2c-********</customerInternalId>
<paymentMethodProfile>
<MethodType>CreditCard</MethodType>
<MethodName>samba</MethodName>
<SecondarySort>0</SecondarySort>
<Created>2021-03-11T00:00:00.000Z</Created>
<Modified>2021-03-11T00:00:00.000Z</Modified>
<AccountHolderName>API Test 001</AccountHolderName>
<AvsStreet>Street# 1 wolf of wall street</AvsStreet>
<AvsZip>54700</AvsZip>
<CardCode>123</CardCode>
<CardExpiration>092022</CardExpiration>
<CardNumber>371122223332241</CardNumber>
</paymentMethodProfile>
</AddCustomerPaymentMethodProfile>
</env:Body>
</env:Envelope>
Response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AddCustomerPaymentMethodProfileResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<AddCustomerPaymentMethodProfileResult>21966</AddCustomerPaymentMethodProfileResult>
</AddCustomerPaymentMethodProfileResponse>
</s:Body>
</s:Envelope>
Updated about 1 year ago