developer:soap-1.6:methods:setdefaultpaymentmethod

Soap API v1.6

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, Custnum, integer PaymentMethodID )

Arguments

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.

Return Value

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(); 
} 
 
?>  
developer/soap-1.6/methods/setdefaultpaymentmethod.txt · Last modified: 2016/06/24 16:55 by charlie

Page Tools