Getting Started with AFCheckKeySDK

You can view a live example on how to use this library here: AFCheckKey SDK Live Example

 

Steps to use AFCheckKeySDK

1. Scripts

Include the following script within your web page code:

<type="text/JavaScript" src="//secure.ftipgw.com/admin/js/AFCheckKeySDK.js"></script>

 

2. Initialize SDK

Use the following code to initialize the AFCheckKey library:

<type="text/javascript" >

$(document).ready(function () {

if (typeof AFCheckKeySDK !='undefined' ) {

AFCheckKeySDK.init();

}

window.AFCheckKeySDK.setTestMode(false);

});

</script>

 

Please Note: If you do not want to send a request to ArgoFire servers, call setTestMode(true) method. With this, dummy responses will be returned.

 

3. Response Format

This SDK returns the same response object for all requests. Take note of the code returned, if it is 200 or 201 the request was successful, otherwise it is an error:

{

statuscode: 0, // 200 is success request, any other is error request.

status:"",

responseObject: {

code: 'OK', //"OK" is for Success request, any other is for error request.

... // And rest of full response of the ArgoFire Api in JSON format.

}

}

Please Note: responseObject.code will describe the result of the request sent to ArgoFire API. If value is 'OK', then the request was successful.

 

4. Create Client Session Id Request

This request should originate from the Integrator's Server Side. The request includes Merchant assigned "Username", "Password" and "Vendor" for the ArgoFire Gateway.

When this request is sent to the ArgoFire API, the ArgoFire server validates the request, generates a ClientSessionID, and returns the ClientSessionID in the response to the Integrator’s server. The ClientSessionID is valid for a configured time after it is generated/received. Currently, this is set to 3600 seconds.

For more details on the GetClientSessionID request click here.

 

5. GetToken

To tokenize an ACH account, the client browser must first send a GetToken request to ArgoFire. The ArgoFire API will return the tokenized account information as a CheckInfoKey. If a CheckInfoKey is already created, skip this step and move on to step 6.

As mentioned, the GetToken request should be requested from the client browser. The request includes "ClientSessionID", "Account Number", "Transit Number", "Name on Account", "Check Type", "Account Type", "Street", "Zip", "First Name" and "Last Name". The ClientSessionID is what you received from the GetClientSessionID request. For reference, the address fields support both US and Canadian addresses.

When this request is sent to the ArgoFire API, the ArgoFire server validates the request, generates a token as a CheckInfoKey, and returns the token/CheckInfoKey in the response to the browser along with the CustomerID and CustomerKey.

Request Object:

let checkObj = {

ClientSessionID: '',

CkAccountNum: '',

CkRoutingNum: '',

CkNameOnAccount: '',

CheckType: '',

AccountType: '',

CkStreet: '',

CkZip: '',

FirstName: '',

LastName: ''

};

 

Javascript SDK method:

AFCheckKeySDK.GetToken(checkObj).then((response) => {

if (response.statuscode == 200) {

if (response.responseObject.code == 'OK') {

token.value = response.responseObject.CheckInfoKey;

} else {

//error

}

} else {

//error

}

});

 

Response Object:

{

statuscode: 200,

status: "success",

responseObject: {

ClientSessionID: "86d10437-786c-4e24-b14f-fe1b252cadfd",

CheckInfoKey: "618679",

code: "OK",

error: "CheckInfoKey generated successfully",

Partner: "100",

Username: "User1",

CustomerID: "19-Test",

CustomerKey: "3293"

}

}

For more details on the GetCheckToken request click here.

 

Please Note: At this stage, it is recommended that you store the CheckInfoKey, CustomerID, and CustomerKey associated with the cardholder in your own data repository. These values will allow you to utilize ArgoFire’s suite of Web services to modify the customer record, generate recurring billings, delete check information from a customer profile, and more. You can find a list of relevant Web services at the bottom of this page.

 

6. Make Payment

ProcessCheck request must be sent by the Integrator Server. After the CheckInfoKey/Token is received, the Integrator Server end will have to send a ProcessCheck request to the ArgoFire API. ArgoFire validates the request, processes the request with respective payment processors and returns the response. The CheckInfoKey will be passed into the request in the ExtData like the below:

<Check_Info_Key>618704</Check_Info_Key>

For more details on the ProcessCheck request click here.

 

Relevant Web Services

ManageCustomer

Add, Update, or Delete a stored customer record

ManageCheckInfo

Add, Update, or Delete stored Check/ACH information for a Customer

Please note: If you intend to update the check information within a particular token, and you do not want to present your own fields to capture ACH information, it is recommended that you DELETE the Customer and associated Check information entirely, then present a new instance of the javascript outlined previously in order to capture the new account information. You can then associate the CheckInfoKey, CustomerID, and CustomerKey to the account holder in your data repository as you did for the initial capture.

ManageContract

Add, Update, or Delete a recurring payment contract for a customer

GetPaymentMethodsByCustomer

Retrieve stored payment methods for a customer