setDefaultPaymentMethod
Set a existing payment method as default for an existing customer.
Description
This method make a specific payment method the default for a customer.
Each customer record may contain multiple payment methods. (Exception: see Beta6 note below.) This option allows you to remove expired or unused payment methods from your customer's records.
New payment methods may be added by using addCustomerPaymentMethod.
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, addCustomerPaymentMethod, updateCustomer, quickUpdateCustomer
Syntax
boolean setDefaultPaymentMethod ( ueSecurityToken Token, string Custnum, string PaymentMethodID )
Arguments
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
string | Custnum | No description available. |
string | PaymentMethodID | The ID of the payment method to be deleted. |
Return Value
Type | Description |
---|---|
boolean | Returns confirmation of that payment method was set to default. If this fails, an exception will be thrown. |
Examples
PHP
For directions on how to set up the WSDL link, create "$token" and "$client", go to PHP Soap How-to.
```php
try {
//Set CustNum for the Customer that you
//want to delete a payment method from
$CustNum="12345678"
//Set PayID for the Payment Method ID
//that you want to delete
$PayID="7654321"
// Delete the payment method
$Result=$client->setDefaultPaymentMethod($token, $CustNum, $PayID);
} catch(Exception $e) {
echo 'Error: ' . $e->getMessage();
}
```
Change Log
Version | Change |
---|---|
1.7 | Changed CustNum and PaymentMethodID to type string |