deleteCustomer
Delete the customer specified by CustNum.
Description
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.
See also runCustomerTransaction, enableCustomer, disableCustomer, searchCustomerID, getCustomer, searchCustomers, getCustomerHistory, addCustomer, addCustomerPaymentMethod, deleteCustomerPaymentMethod, updateCustomer, quickUpdateCustomer
Syntax
boolean deleteCustomer ( ueSecurityToken Token, string CustNum )
Arguments
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
string | CustNum | A unique customer number assigned by the gateway. |
Return Value
| Type | Description | | ---- | ---- | ----------- | boolean | Returns confirmation of request only if successful. If request 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 <?php
try {
$custnum=$this->createCustomer();
$res=$client->deleteCustomer($token, $custnum);
$this->assertTrue($res);
}
catch(SoapFault $e) {
die("soap fault: " .$e->getMessage());
}
?>
Java
This example uses the Newtek Gateway Java library. For directions on how to install the library and create the token/client objects, go to the Java JAX-WS Howto.
try {
//Set CustNum for Customer you want to delete
BigInteger CustNum = BigInteger("12345678");
//Delete Customer
client.deleteCustomer(token, CustNum);
} catch (Exception e) {
System.out.println("Soap Exception: " + e.getMessage());
}
.NET VB
Dim custNum As String
custNum = "103125"
Dim response As Boolean
response = client.deleteCustomer(token, custNum)
MsgBox(response)
.NET C
string custNum = "89792";
Boolean response;
try
{
response = client.deleteCustomer(token, custNum);
if (response)
{
MessageBox.Show(string.Concat("Succesfull"));
}
else MessageBox.Show(string.Concat("Error!"));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
XML
Request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:newtek"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:deleteCustomer>
<Token xsi:type="ns1:ueSecurityToken">
<ClientIP xsi:type="xsd:string">123.123.123.123</ClientIP>
<PinHash xsi:type="ns1:ueHash">
<HashValue xsi:type="xsd:string">18abc8b8381259e9aea49d5e89a39521ff8a2666</HashValue>
<Seed xsi:type="xsd:string">12130139400-test</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
</Token>
<CustNum xsi:type="xsd:string">4600537</CustNum>
</ns1:deleteCustomer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:newtek"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:deleteCustomerResponse>
<deleteCustomerReturn xsi:type="xsd:boolean">true</deleteCustomerReturn>
</ns1:deleteCustomerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>