Kwrapper Integration

The Kwrapper is a method for PSP (payment or merchant aggregator) to create a JavaScript wrapper for the Kount Device Collector. The Kwrapper is meant for use with Kount Central clients to integrate the Device Collector into their sub-merchant's order/transaction workflow. The Kwrapper still requires HTML code to be inserted into the customer's checkout/transaction page, but it simplifies the process (compared to inserting the full device collector JS/HTML).


  • The Kwrapper simplifies the Device Collector code integration for the sub-merchants that are under a PSP/payment aggregator.

  • The Kwrapper is a single JavaScript file that the PSP adds to their gateway that creates an iFrame instantly to gather device data.

  • The Kwrapper requires the PSP to store the generated SessionID value in their database to then pass to Kount for future Risk Inquiry Service (RIS) calls associated with the transaction.

    The only requirements of the customer is to insert a short snippet of JavaScript code onto their order/transaction page (checkout page).

What are the benefits of this feature?

  • It eliminates the need for the customer to have to generate, store and manage the SessionID values.

  • The SessionID handling is offloaded to the PSP.

  • The customer only needs to add a small snippet of JavaScript to their checkout (or equivalent) page, and edit the value of minimally two values (MerchantID and FormID, with optional SiteID if PSP is offering custom rules per-merchant site).

When to use this feature?

The Kwrapper is for use with Kount Central customers who do not want to burden their customers with having to manage SessionID generation and storage.

Technical Details

  • The customer embeds a small snippet of JavaScript code into their checkout/transaction page that has a few options to configure.

  • The two use cases for the Kwrapper are either for Portfolio-level Kount rules (Kount Central Portfolio) or Merchant-level Kount rules (Kount Central Fraud Manager or Kount Central Enterprise):

    Kount Central Portfolio use case: No SiteID needed.

  • Kount Central Fraud Manager or Kount Central Enterprise: Need a SiteID value to identify the merchant.

Gateway steps

Implement Device Data Collector and RIS as normal for pertinent environments.


  • Device Data Collector:

  • RIS:

  • AWC:


  • Device Data Collector:

  • RIS:

  • AWC:

The TEST and PROD environment logo.htm and logo.gif paths need to be added to the Kwrapper.js file along with the customer's MID in place of XXXXXX.

Lines 892-896

test: new WrapperData.Environment("test", "", "XXXXXX"),
prod: new WrapperData.Environment("prod", "", "XXXXXX"),
beta: new WrapperData.Environment("beta", "", "XXXXXX"),

Image size in kwrapper.js file needs set to match image size of redirect image.

Lines 968-969

iframe.width = 88; // can change to 1
iframe.height = 31; // can change to 1

Gateway/PSP must make edits in kwrapper and create documentation to provide to customers who own the checkout pages on how to initialize kwrapper library.

Example of what gateway would document for their merchants on how to use kwrapper.js.

FormDOMid is provided by merchant from checkout form by a form ID

<form id=" FormDOMid">
[form details here]
<script src=""></script>

Customer steps

Create a form ID for the checkout form.

Add JavaScript to the checkout page specifying the Gateway MID, checkout form ID, and environment.

<form id=" FormDOMid">
[form details here]

<script src=""></script>

Passing a SiteID (Optional)

The WrapperData.setup() method, by default, takes two parameters:

  1. FormDOMID: The form ID used by the web-form on the page the kwrapper is used.

  2. WrapperData.environments.NAME: The environment name configured in the kwrapper code on lines 892-896.

  3. Optionally, it can take a third parameter, SiteID. This is the unique website ID for customers that have more than one website:

    WrapperData.setup('yourFormDOMId',, 'SiteID');

Was this article helpful?
0 out of 0 found this helpful