Retrieve a specific customer payment method for a given CustNum.
This method allows you to retrieve a specific payment method 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.
You must also specify the MethodID for the desired Payment Method. This MethodID is assigned by the gateway and returned by addCustomerPaymentMethod. You can also obtain the methodid from the MethodID property of the PaymentMethod object. This is returned by either getCustomer or getCustomerPaymentMethods.htm.
PaymentMethod getCustomerPaymentMethod ( ueSecurityToken Token, integer CustNum, integer MethodID )
Type |
Name |
Description |
Token |
Merchant security token: used to identify merchant and validate transaction. |
|
integer |
CustNum |
Unique customer ID number assigned by the gateway. |
integer |
MethodID |
Unique payment method ID assigned by the gateway. |
Returns a PaymentMethod object |
<?php
try {
$custnum = '532';
$methodid = '1234';
$paymethod = $client->getCustomerPaymentMethod($token,$custnum,$methodid);
print_r($paymethod);
echo $paymethod->MethodName . "\n";
} catch(SoapFault $e) {
echo $e->getMessage();
echo "\n\nRequest: " . $client->__getLastRequest();
echo "\n\nResponse: " . $client->__getLastResponse();
}
?>
Dim CustNum As String
CustNum = "103125"
Dim MethodID As String
MethodID = "39"
Dim Method As eBizCharge.PaymentMethod = New eBizCharge.PaymentMethod
Method = client.getCustomerPaymentMethod(token, CustNum, MethodID)
MsgBox(Method.Created)
string CustNum = "89147";
string MethodID = "19";
eBizCharge.PaymentMethod Method = new eBizCharge.PaymentMethod();
try {
Method = client.getCustomerPaymentMethod(token, CustNum, MethodID);
MessageBox.Show(string.Concat(Method.Created));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
try {
//Set custnum to the Customer Number of customer you
//want to retrieve a payment method from.
BigInteger custnum = new BigInteger("12345678");
//Set PayID to the Payment Method ID of the
//Payment Method you want to retrieve.
BigInteger PayID = new BigInteger("654321");
PaymentMethod PayMethod = new PaymentMethod();
PayMethod = client.getCustomerPaymentMethod(token, custnum, PayID);
} catch (Exception e) {
System.out.println("Soap Exception: " + e.getMessage());
}