Update customer data in selected fields only.
This method allows you to update only specified data for a customer record, rather than replacing all existing data. Fields that can be changed using this method include a customer's contact information, as well as customized notes on their account and information regarding any recurring billing cycle that they have been enabled for, such as the amount to be billed, and the number of transactions remaining.
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.
This method uses the UpdateData array containing the fields that you would like to update. The “key” of each element is the name of the field you wish to change and the “value” of the element is the new value that you would like to assign.
The following fields may be updated using this method:
boolean quickUpdateCustomer ( ueSecurityToken Token, integer CustNum, FieldValue UpdateData )
Type |
Name |
Description |
Token |
Merchant security token: used to identify merchant and validate transaction. |
|
integer |
CustNum |
A unique customer number assigned by the gateway. |
UpdateData |
Array of fields to be updated. |
boolean |
Returns confirmation of request only if successful. If request fails, an exception will be thrown. |
<?php
try {
$custnum='532';
$update=array(
array('Field'=>'CardExp' , 'Value'=>'0913'),
array('Field'=>'CardNumber', 'Value'=>'4444555566667779'),
array('Field'=>'Amount' , 'Value'=>'1.34'),
array('Field'=>'Address' , 'Value'=>'Time: ' . mktime()),
array('Field'=>'CustomData', 'Value'=> serialize(array("MyField" => "myval"))),
);
print_r($client->quickUpdateCustomer($token,$custnum, $update));
}
catch(SoapFault $e) {
echo "Error: " . $e->faultstring;
echo "\n\nRequest: " . $client->__getLastRequest();
echo "\n\nResponse: " . $client->__getLastResponse();
}
catch(Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>
try {
BigInteger custnum = new BigInteger("1235");
// Create array of fields to update
FieldValueArray updateData = new FieldValueArray();
updateData.add(new FieldValue("Schedule", "daily"));
updateData.add(new FieldValue("Amount", "5.00"));
// run quick update
boolean response = client.quickUpdateCustomer(token, custnum, updateData);
} catch (Exception e) {
System.out.println("Soap Exception: " + e.getMessage());
}
Dim custNum As String
custNum = "103125"
Dim fields(0 To 1) As eBizCharge.FieldValue
For i As Integer = 0 To 1
fields(i) = New eBizCharge.FieldValue
Next i
fields(0).Field = "Schedule"
fields(0).Value = "monthly"
fields(1).Field = "Amount"
fields(1).Value = "5.00"
Dim response As Boolean
response = client.quickUpdateCustomer(token, custNum, fields)
MsgBox(response)
string custNum = "89147";
eBizCharge.FieldValue[] fields = new eBizCharge.FieldValue[2];
for (int i = 0; i < 2; i++) {
fields[i] = new eBizCharge.FieldValue();
}
fields[0].Field = "Schedule"; fields[0].Value = "monthly";
fields[1].Field = "Amount"; fields[1].Value = "5.00";
Boolean response;
try
{
response = client.quickUpdateCustomer(token, custNum, fields);
MessageBox.Show(string.Concat(response));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}