getCustomerPaymentMethod

Parent Previous Next

getCustomerPaymentMethod

Retrieve a specific customer payment method for a given CustNum.

 

Description

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.

 

Syntax

PaymentMethod getCustomerPaymentMethod ( ueSecurityToken Token, integer CustNum, integer MethodID )

 

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.

integer

MethodID

Unique payment method ID assigned by the gateway.

 

Return Value

 

PaymentMethod

Returns a PaymentMethod object

 

Examples

 

PHP

 

<?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();

}

?>

 

 

.NET VB

 

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)

 

 

.NET C#

 

           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);

           }

 

 

Java

 

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());

}

: