developer:soap:methods:getcustomerpaymentmethods

Soap API v1.2

getCustomerPaymentMethods

Retrieve the customer payment methods for a given CustNum.

Description

This method allows you to retrieve all of the payment methods stored for a particular customer.

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 getCustomer

Syntax

PaymentMethod getCustomerPaymentMethods ( ueSecurityToken Token, integer CustNum )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
integer CustNum Unique customer ID number assigned by the gateway.

Return Value

PaymentMethod Returns Array of PaymentMethod objects.

Examples

PHP

<?php 
 
// for directions on how to set up the  
// WSDL link and create "$token" and "$client," 
// see: http://usaepay.com/developer/howto/php. 
 
try { 
 
   $custnum='532'; 
   $paymethods = $client->getCustomerPaymentMethods($token,$custnum); 
 
   print_r($paymethods);
 
   echo "Found " . count($paymethods) . " payment methods: \n";
   foreach($paymethods as $paymethod)
   {
        echo $paymethod->MethodName . "\n";
   }
 
} catch(SoapFault $e) { 
 
     echo $e->getMessage(); 
     echo "\n\nRequest: " . $tran->__getLastRequest(); 
     echo "\n\nResponse: " . $tran->__getLastResponse(); 
} 
 
?> 

Java

This example uses the USAePay Java library. For directions on how to install the library and create the token/client objects, go to either the Java JAX-RPC Howto or the Java JAX-WS Howto.

try {
  //Set custnum to the Customer Number of customer you want to 
  //retrieve payment methods from.
  BigInteger custnum = new BigInteger;
  PaymentMethodArray PaymentMethods = new PaymentMethodArray();
 
  PaymentMethods = client.getCustomerPaymentMethods(token, custnum);
} catch (Exception e) {
    System.out.println("Soap Exception: " + e.getMessage());
}

Change History

Version Change
1.2 The getPaymentMethods method was added in release 1.2
developer/soap/methods/getcustomerpaymentmethods.txt · Last modified: 2009/09/08 13:10 by charlie

Page Tools