developer:soap-1.4:methods:getcustomerpaymentmethod

Soap API v1.4

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.

See also getCustomer and getCustomerPaymentMethods

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

For directions on how to set up the WSDL link, create “$token” and “$client” please see the SOAP PHP Howto.

<?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 usaepay.PaymentMethod = New usaepay.PaymentMethod
 
        Method = client.getCustomerPaymentMethod(token, CustNum, MethodID)
        MsgBox(Method.Created)

.NET C#

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";
            string MethodID = "19";
 
            usaepay.PaymentMethod Method = new usaepay.PaymentMethod();
 
            try {
                Method = client.getCustomerPaymentMethod(token, CustNum, MethodID);
                MessageBox.Show(string.Concat(Method.Created));
            }
 
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }

Java

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

Change History

Version Change
1.2 The getPaymentMethod method was added in release 1.2
developer/soap-1.4/methods/getcustomerpaymentmethod.txt · Last modified: 2010/09/09 12:06 by irina

Page Tools