updateCustomer

Parent Previous Next

updateCustomer

Replace all data for customer specified by CustNum.

 

Description

This method completely replaces all existing customer data for a specific 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.

If you wish to change all of the data EXCEPT for the credit card or checking account information, you must type XXXX into the credit card or check fields. This will change all of the other data, while saving the previously stored credit card and checking information.

Depending on your programming language, you should be able to retrieve the customer object using the getCustomer method, alter any fields you want and then submit it back using the updateCustomer method.

To update only a few specific fields, use the quickUpdateCustomer.html method.

 

Syntax

boolean updateCustomer ( ueSecurityToken Token, integer CustNum, CustomerObject CustomerData )

 

Arguments

 

Type

Name

Description

ueSecurityToken

Token

Merchant security token: used to identify merchant and validate transaction.

integer

CustNum

A unique customer number assigned by the gateway.

CustomerObject

CustomerData

Includes customer information such as customer number, merchant assigned customer ID, billing address, receipt settings, recurring billing settings, and other pertinent information.

 

Return Value

 

boolean

Returns confirmation of customer update only if data revision was successful. If update fails, an exception will be thrown.

 

Examples

 

PHP

 

<?php

try {

 $customer=$tran->getCustomer($token, 1309);

 $customer->Amount=29.99;

 $customer->Description='New Description';

 $res=$client->updateCustomer($token, 1309, $customer);

 print_r($res);

}

catch(SoapFault $e) {

 echo "SoapFault: " .$e->getMessage();

 print_r($e);

 echo "\n\nRequest: " . $client->__getLastRequest();

 echo "\n\nResponse: " . $client->__getLastResponse();

}

?>

 

 

.NET VB

 

Dim CustNum As String

       CustNum = "103125"

       Dim customer As eBizCharge.CustomerObject = New eBizCharge.CustomerObject

       customer = client.getCustomer(token, CustNum)

       customer.Amount = 29.99

       Dim response As Boolean

       response = client.updateCustomer(token, CustNum, customer)

       MsgBox(response)

 

 

.NET C#

 

           string CustNum = "89147";

           eBizCharge.CustomerObject customer = new eBizCharge.CustomerObject();

           customer = client.getCustomer(token, CustNum);

           customer.Amount = 29.99;

           Boolean response;

           try

           {

               response = client.updateCustomer(token, CustNum, customer);

               MessageBox.Show(string.Concat(response));

           }

           catch (Exception err)

           {

               MessageBox.Show(err.Message);

           }

: