Retrieve the customer payment methods for a given CustNum.
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
| 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. |
<?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();
}
?>
Dim CustNum As String
CustNum = "103125"
Dim Method() As usaepay.PaymentMethod
Method = client.getCustomerPaymentMethods(token, CustNum)
MsgBox(Method.Length)
For directions on how to set up the WSDL link and create the “token” and “client” variables, go to the C Sharp .Net Soap How-to.
string CustNum = "89147";
try
{
usaepay.PaymentMethod[] Method = client.getCustomerPaymentMethods(token, CustNum);
MessageBox.Show(string.Concat(Method.Length));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
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());
}
| Version | Change |
| 1.2 | The getPaymentMethods method was added in release 1.2 |