Set a existing payment method as default for an existing customer.
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
boolean setDefaultPaymentMethod ( ueSecurityToken Token, Custnum, integer PaymentMethodID )
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
integer | Custnum | No description available. |
integer | PaymentMethodID | The ID of the payment method to be deleted. |
boolean | Returns confirmation of that payment method was set to default. If this fails, an exception will be thrown. |
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(); } ?>