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
PaymentMethod getCustomerPaymentMethods ( ueSecurityToken Token, integer CustNum )
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. |
PaymentMethod | Returns Array of PaymentMethod objects. |
<?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(); } ?>
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()); }
string CustNum = "96319"; try { usaepay.PaymentMethod[] Method = client.getCustomerPaymentMethods(token, CustNum); MessageBox.Show(string.Concat(Method.Length)); } catch (Exception err) { MessageBox.Show(err.Message); }
Version | Change |
---|---|
1.2 | The getPaymentMethods method was added in release 1.2 |