getCustomerPaymentMethods

Parent Previous Next

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.

 

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://eBizCharge.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();

}

?>

 

 

.NET VB

 

Dim CustNum As String

       CustNum = "103125"

       Dim Method() As eBizCharge.PaymentMethod

       Method = client.getCustomerPaymentMethods(token, CustNum)

       MsgBox(Method.Length)

 

 

.NET C#

 

           string CustNum = "89147";

           try

           {

              eBizCharge.PaymentMethod[] Method = client.getCustomerPaymentMethods(token, CustNum);

               MessageBox.Show(string.Concat(Method.Length));

           }

           catch (Exception err)

           {

               MessageBox.Show(err.Message);

           }

 

 

Java

 

 

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

}

: