SetDefaultCustomerPaymentMethodProfile
Description
The SetDefaultCustomerPaymentMethodProfile method sets an existing PaymentMethodProfile as the default payment method for a Customer.
Syntax
boolean SetDefaultCustomerPaymentMethodProfile(SecurityToken securityToken, string customerToken, string paymentMethodId)
Arguments
Type | Name | Description | |
|---|---|---|---|
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. |
string | paymentMethodId | R | Identifies the PaymentMethodProfile to set as the default. |
Return Value
| Type | Description |
|---|---|
| boolean | Returns true if the PaymentMethodProfile was set as the default. Otherwise, returns false. |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header />
<soapenv:Body>
<ebiz:SetDefaultCustomerPaymentMethodProfile>
<ebiz:securityToken>
<ebiz:SecurityId>***********44e8-9e9b***********</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:customerToken>****1234</ebiz:customerToken>
<ebiz:paymentMethodId>123</ebiz:paymentMethodId>
</ebiz:SetDefaultCustomerPaymentMethodProfile>
</soapenv:Body>
</soapenv:Envelope>var client = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken
{
SecurityId = "***********4bf0-91cd***********",
UserId = "",
Password = ""
};
string customerToken = "****1803";
string paymentMethodId = "12097";
bool result = client.SetDefaultCustomerPaymentMethodProfile(securityToken, customerToken, paymentMethodId);
Console.WriteLine($"{result}");function SetDefaultCustomerPaymentMethodProfile()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '***********4757-4567***********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$getCustomer = $client->SetDefaultCustomerPaymentMethodProfile(array(
'securityToken' => $securityToken,
'customerToken' => '****1234',
'paymentMethodId' => '1'
));
$getCustomerResult = $getCustomer->GetCustomerResult;
}Example Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetDefaultCustomerPaymentMethodProfileResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<SetDefaultCustomerPaymentMethodProfileResult>true</SetDefaultCustomerPaymentMethodProfileResult>
</SetDefaultCustomerPaymentMethodProfileResponse>
</s:Body>
</s:Envelope><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">
<SetDefaultCustomerPaymentMethodProfileResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<SetDefaultCustomerPaymentMethodProfileResult>false</SetDefaultCustomerPaymentMethodProfileResult>
</SetDefaultCustomerPaymentMethodProfileResponse>
</s:Body>
</s:Envelope>Updated 4 months ago
