enableCustomer

Enable recurring billing for a customer specified by CustNum.

Description

This method allows you to begin a recurring billing cycle for an individual customer using their CustNum (unique customer number assigned by the gateway) as a reference. If you have lost or cannot remember the customer's CustNum, use the searchCustomerID method to retrieve it.

The recurring billing cycle can begin on any date you choose and can be set to any of the following cycles: Daily, Weekly, Bi-Weekly (every 2 weeks), Monthly, Bi-Monthly (every 2 months), Quarterly, Bi-Annually (every 6 months), and Annually.

You can also set the start and end dates, amount to be charged, and the total number of transactions for the recurring billing cycle.

Once a customer has been added to a recurring billing cycle, you can monitor and change the recurring billing settings from within the merchant console.

You can disable a customer's recurring billing cycle at any time using the disableCustomer method.

For more information about recurring billing, please refer to the support documentation in the merchant console.

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

Syntax

boolean enableCustomer ( 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 result of recurring billing request. Possible values are: Approved, Error, or Declined.

Examples

PHP

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


    try {

      $custnum="12345678";

      $res=$client->enableCustomer($token, $custnum);     

      }

    catch(SoapFault $e) {

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

      }
    ```



### Java

This example uses the [Newtek Gateway Java library](http://help.newtekgateway.com/developer/sdks/java/).  For directions on how to install the library and create the token/client objects, go to the [Java JAX-WS Howto](http://help.newtekgateway.com/developer/soap-api/howto/javajaxws).

```java
    try {
      //Set CustNum for the Customer that you want to enable
      BigInteger CustNum = new BigInteger("12345678");

      client.enableCustomer(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.enableCustomer(token, custNum)
            MsgBox(response)

.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";

                Boolean response;

                try
                {
                    response = client.enableCustomer(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:enableCustomer>
    <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">850e5f0b4fcc4fe4dc6a4db54ddeb7b78bb2c951</HashValue>
    <Seed xsi:type="xsd:string">1396230635-test</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
    <CustNum xsi:type="xsd:string">4603318</CustNum>
    </ns1:enableCustomer>
    </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:enableCustomerResponse>
    <enableCustomerReturn xsi:type="xsd:boolean">true</enableCustomerReturn>
    </ns1:enableCustomerResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 Changed CustNum to type string