developer:soap-1.2:methods:updatecustomer

Soap API v1.2

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 method.

See also runCustomerTransaction, enableCustomer, disableCustomer, deleteCustomer, searchCustomerID, getCustomer, searchCustomers, getCustomerHistory, addCustomer, addCustomerPaymentMethod, deleteCustomerPaymentMethod, quickUpdateCustomer

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

For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.

<?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 = "115163"
 
        Dim customer As usaepay.CustomerObject = New usaepay.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 = "105619";
 
            usaepay.CustomerObject customer = new usaepay.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);
            }
developer/soap-1.2/methods/updatecustomer.txt · Last modified: 2010/10/20 11:42 by irina

Page Tools