This method allows you to add a new payment method to a customer record.


Multiple payment methods may 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.

To set a payment method as default, pass “true” for the MakeDefault parameter. Setting a payment method to default overrides the SecordarySort parameter and sets it to 0. If another method is currently set to default, it will have its SecondarySort changed to 1.

All new payment methods will be validated by the system to be sure that the information entered fits the required format for the specified payment method. (ie: Does the credit card have 16 digits and a future expiration date? Does the check routing number have 9 digits?)

To further verify that a credit card is “good”, set the Verify parameter to “true” (available for credit cards only). This setting will cause the gateway to run an AuthOnly transaction for $0.05. Any fraud modules that are configured for the source will be run. If the transaction is declined the payment method will not be stored and a fault will be thrown with the decline or error message.

If the Verify parameter is set to “false,” the payment data will still be checked to ensure that it is formatted correctly, but the credit card validity will not be verified.

If any errors are detected or the Verify fails, a fault will be thrown. This method requires the use of the CustNum, a unique customer number assigned by the gateway. If you have lost or cannot remember the customer's CustNum, use the searchCustomers method to find the correct CustNum.

See also runCustomerTransaction, enableCustomer, disableCustomer, deleteCustomer, searchCustomerID, getCustomer, searchCustomers, getCustomerHistory, addCustomer, deleteCustomerPaymentMethod, updateCustomer, quickUpdateCustomer


integer addCustomerPaymentMethod ( ueSecurityToken Token, integer CustNum, PaymentMethod PaymentMethod, boolean MakeDefault, boolean Verify )


Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
integer CustNum A unique customer number assigned by the gateway.
PaymentMethod PaymentMethod Includes method name, description, ID, and expiration date.
boolean MakeDefault Determines default payment method for specified customer. If set to true, payment method will be marked as default.
boolean Verify If set to true, an AuthOnly verification of the credit card validity will be run. (See above.)

Return Value

integer Returns result of the request and, if approved, the ID of the new payment method.



For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.

try { 
    'MethodID' => '0', 
    'CreditCardData' => array( 
  $res=$client->addCustomerPaymentMethod($token,$CustNum, $PaymentMethod, $Default, $Verify); 
  $this->assertTrue($res>0, 'Positive PaymentMethodID');  
catch(SoapFault $e) { 
  echo "\n\nResponse: " . $tran->__getLastResponse(); 
  die("soap fault: " .$e->getMessage()); 
  echo "SoapFault: " .$e->getMessage(); 
  echo "\n\nRequest: " . $tran->__getLastRequest(); 


Dim CustNum As String
        CustNum = "120221"
        Dim payMethod As usaepay.PaymentMethod = New usaepay.PaymentMethod
        payMethod.CreditCardData = New usaepay.CreditCardData
        payMethod.CreditCardData.CardExpiration = "1212"
        payMethod.CreditCardData.CardNumber = "4000100011112224"
        payMethod.CreditCardData.AvsStreet = "123 Main st."
        payMethod.CreditCardData.AvsZip = "90046"
        payMethod.MethodName = "My Visa"
        Dim response As String
        response = client.addCustomerPaymentMethod(token, CustNum, payMethod, False, True)


string CustNum = "109100";
            usaepay.PaymentMethod payMethod = new usaepay.PaymentMethod();
            payMethod.CreditCardData = new usaepay.CreditCardData();
            payMethod.CreditCardData.CardExpiration = "1212";
            payMethod.CreditCardData.CardNumber = "4000100011112224";
            payMethod.CreditCardData.AvsStreet = "123 Main st.";
            payMethod.CreditCardData.AvsZip = "90046";
            payMethod.MethodName = "My Visa";
            string response;
                response = client.addCustomerPaymentMethod(token, CustNum, payMethod, false, true);
            catch (Exception err)

Change Log

Version Change
1.0 Verify parameter implemented.
beta6 Method added. (See notes below)

Please Note: Beta6 supports only one payment method for each customer. This means that if you add a new payment method to a customer's account, the new method will overwrite the existing method.

Beta6 also overrides the Verify parameter, so if you add a customer payment method, the gateway will not run the AuthOnly charge of $0.01 to verify that the credit card is valid. The data will still be validated to ensure that it is in the correct format, but the Verify parameter will not be run.

developer/soap-1.1/methods/addcustomerpaymentmethod.txt · Last modified: 2010/10/21 15:47 by irina

Page Tools