UpdateCustomerPaymentMethodProfile

Description

The UpdateCustomerPaymentMethodProfile method updates an existing PaymentMethodProfile on the EBizCharge platform. The payment method can be updated to a credit card or bank account.

Syntax

boolean UpdateCustomerPaymentMethodProfile(SecurityToken securityToken, string customerToken, PaymentMethodProfile paymentMethodProfile)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

string

customerToken

R

Identifies the Customer associated with the stored payment method.

Note: Retrieve this value using GetCustomerToken.

PaymentMethodProfile

paymentMethodProfile

R

Updated payment method profile.

Warning: Omitting a field may clear its value.

Required Fields

Required when updating a credit card:

  • CardExpiration
  • CardNumber

Required when updating a bank account:

  • Account
  • Routing
Recommended Fields
  • MethodName
  • AccountHolderName
  • DriversLicense
  • DriversLicenseState

Return Value

TypeDescription
booleanOn success, true is returned. Otherwise, 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:UpdateCustomerPaymentMethodProfile>
         <ebiz:securityToken>
            <ebiz:SecurityId>***********4621-b899***********</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:customerToken>*****1069</ebiz:customerToken>
         <ebiz:paymentMethodProfile>
            <ebiz:MethodID>22</ebiz:MethodID>
            <ebiz:MethodName/>
            <ebiz:SecondarySort/>
            <ebiz:Account/>
            <ebiz:AccountType/>
            <ebiz:AccountHolderName/>
            <ebiz:DriversLicense/>
            <ebiz:DriversLicenseState/>
            <ebiz:Routing/>
            <ebiz:AvsStreet/>
            <ebiz:AvsZip/>
            <ebiz:CardCode/>
            <ebiz:CardExpiration>2028-12</ebiz:CardExpiration>
            <ebiz:CardNumber>************2224</ebiz:CardNumber>
         </ebiz:paymentMethodProfile>
      </ebiz:UpdateCustomerPaymentMethodProfile>
   </soapenv:Body>
</soapenv:Envelope>
var client = new IeBizServiceClient();

SecurityToken securityToken = new SecurityToken
{
    SecurityId = "***********b2f0-91cd***********",
    UserId = "",
    Password = ""
};

string customerToken = "****1803";
string paymentMethodId = "12097";

// Get the full existing payment method object
var paymentMethodProfile = client.GetCustomerPaymentMethodProfile(securityToken, customerToken, paymentMethodId);

// Modify the object
paymentMethodProfile.CardExpiration = "1240";

// Update the payment method
bool result = client.UpdateCustomerPaymentMethodProfile(securityToken, customerToken, paymentMethodProfile);
Console.WriteLine($"{result}");
function updateCustomerPaymentMethodProfile()
{
  $client = new SoapClient('End point URL');
  $securityToken = array(
    'SecurityId' => '***********4757-4567***********',
    'UserId' => 'merchant1',
    'Password' => 'merchant1'
  );
  $paymentMethodProfile = array(
    'MethodID' => '19',
    'CardNumber' => '************2224',
    'CardExpiration' => '1225',
    'AvsStreet' => '20 Pacifica',
    'AvsZip' => '92618',
    'MethodName' => 'New Name',
    'AccountHolderName' => 'Tim Smith'
  );
  $UpdateCustomer = $client->UpdateCustomerPaymentMethodProfile(
    array(
    'securityToken' => $securityToken,
    'customerToken' => '****1504',
    'paymentMethodProfile' => $paymentMethodProfile
  ))
    ;
  $updateCustomerResult = $UpdateCustomer->UpdateCustomerPaymentMethodProfileResult;
}

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">
      <UpdateCustomerPaymentMethodProfileResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateCustomerPaymentMethodProfileResult>true</UpdateCustomerPaymentMethodProfileResult>
      </UpdateCustomerPaymentMethodProfileResponse>
   </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">Invalid CardExpiration Date</faultstring>
      </s:Fault>
   </s:Body>
</s:Envelope>