AddCustomerPaymentMethodProfile
Description
The AddCustomerPaymentMethodProfile method adds a payment method to a Customer.
There is no limit to the number of payment methods that can be saved. However, only one payment method may be designated as the default for all future transactions, including recurring billing and manual charges.
All new payment methods are validated by the system to ensure that the information entered meets the required format for the specified payment type (i.e., Does the credit card have 16 digits and a future expiration date? Does the check routing number have 9 digits?).
Syntax
string AddCustomerPaymentMethodProfile(SecurityToken securityToken, string customerInternalId, PaymentMethodProfile paymentMethodProfile)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
string | customerInternalId | R | Indicates the Customer object for which to add a payment method profile. |
paymentMethodProfile | R | Details of the payment method profile. Required Fields
Fields to not include if unused
|
Return Value
| Type | Description |
|---|---|
| string | Returns the ID of the new payment method. If an error occurs, a fault is returned. |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header/>
<soapenv:Body>
<ebiz:AddCustomerPaymentMethodProfile>
<ebiz:securityToken>
<ebiz:SecurityId>***********01b6-36c2***********</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:customerInternalId>***********2f61-8d68***********</ebiz:customerInternalId>
<ebiz:paymentMethodProfile>
<ebiz:MethodType/>
<ebiz:MethodID/>
<ebiz:MethodName/>
<ebiz:SecondarySort/>
<ebiz:Created/>
<ebiz:Modified/>
<ebiz:Account/>
<ebiz:AccountType/>
<ebiz:AccountHolderName>test</ebiz:AccountHolderName>
<ebiz:DriversLicense/>
<ebiz:DriversLicenseState/>
<ebiz:RecordType/>
<ebiz:Routing/>
<ebiz:AvsStreet>123 Main st.</ebiz:AvsStreet>
<ebiz:AvsZip>11111</ebiz:AvsZip>
<ebiz:CardCode/>
<ebiz:CardExpiration>1228</ebiz:CardExpiration>
<ebiz:CardNumber>************0224</ebiz:CardNumber>
<ebiz:CardType/>
<ebiz:Balance/>
<ebiz:MaxBalance/>
<ebiz:AutoReload/>
<ebiz:ReloadSchedule/>
<ebiz:ReloadThreshold/>
<ebiz:ReloadAmount/>
<ebiz:ReloadMethodID/>
</ebiz:paymentMethodProfile>
</ebiz:AddCustomerPaymentMethodProfile>
</soapenv:Body>
</soapenv:Envelope>var client = new IeBizServiceClient();
// Configure the API SecurityToken to use for API authentication
SecurityToken securityToken = new SecurityToken
{
SecurityId = "***********4bf0-91cd***********",
UserId = "",
Password = ""
};
// The payment method object to be added
PaymentMethodProfile paymentMethod = new PaymentMethodProfile();
paymentMethod.MethodType = "CreditCard";
paymentMethod.MethodName = "Work Visa";
paymentMethod.AccountHolderName = "Test Customer";
paymentMethod.CardNumber = "************2224";
paymentMethod.CardExpiration = "0930";
paymentMethod.CardCode = "123";
paymentMethod.AvsStreet = "123 Main st.";
paymentMethod.AvsZip = "90046";
// Add the payment method and receive the tokenId back from the API
String id = client.AddCustomerPaymentMethodProfile(securityToken, "***********42e8-a8ca***********", paymentMethod);function addCustomerPaymentMethod()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '***********4757-4567***********'
'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' => '************2224',
'CardType' => '90046',
'Balance' => '44',
'MaxBalance' => '50',
);
$paymentMethod = $client->addCustomerPaymentMethodProfile(
array(
'securityToken' => $securityToken,
'customerInternalId' => '***********4573-2384***********',
'paymentMethodProfile' => $customerPayment
));
$paymentMethodId = $paymentMethod->AddCustomerPaymentMethodProfileResult;
if ($paymentMethodId)
echo "Payment Method Added Sucessfully";
}Example 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><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:InvalidCardExpirationDate</faultcode>
<faultstring xml:lang="en-US">Card Expired</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>Updated 4 months ago
