Collecting device data

To help detect fraud, use dataCollector to collect information about a customer's device on your checkout page. Device data collection capabilities are included in version 2.16.0+ of our JavaScript SDK, but these versions only support sending device data for Kount. To take advantage of device data collection with our Fraud Protection product, please upgrade to the latest version of the JavaScript SDK, v3.

To collect device data, pass some additional dataCollector options to your braintree.setup call. The following example is for custom, but will also work for dropin.

JavaScript
braintree.setup(CLIENT_AUTHORIZATION, 'custom', {
  dataCollector: {
    kount: {environment: 'sandbox'}
  },
  onReady: function (braintreeInstance) {
    // At this point, you should access the braintreeInstance.deviceData value
    // and provide it to your server, e.g. by injecting it into your form as a
    // hidden input.
    deviceData = braintreeInstance.deviceData;
  }
  /* ... */
});

Available options for dataCollector.kount.environment:

  • sandbox
  • production

The braintreeInstance returned by onReady will have an additional deviceData string value. It is up to you to provide this value to your server. The most common mechanism for this is to inject the device data value into your form as a hidden input inside of your onReady callback.

JavaScript
braintree.setup(CLIENT_AUTHORIZATION, 'custom', {
  dataCollector: {
    kount: {environment: 'sandbox'}
  },
  onReady: function (braintreeInstance) {
    var form = document.getElementById('my-form-id');
    var deviceDataInput = form['device_data'];

    if (deviceDataInput == null) {
      deviceDataInput = document.createElement('input');
      deviceDataInput.name = 'device_data';
      deviceDataInput.type = 'hidden';
      form.appendChild(deviceDataInput);
    }

    deviceDataInput.value = braintreeInstance.deviceData;
  }
  /* ... */
});

Standalone usage

If you are not using braintree.setup for your integration, you can still collect device data by setting up the data collector directly through braintree.data.setup:

JavaScript
var dataCollector = braintree.data.setup({
  kount: {environment: 'sandbox'},
});

dataCollector.deviceData; /* for use in transaction creation */

You can use the teardown method to reset to a clean state; the same best practices apply to calling teardown on braintree.data.setup as do braintree.setup. In the case of braintree.data.setup calling teardown will invalidate any previously generated device data from the client session.

JavaScript
dataCollector.teardown(); /* for cleanly resetting your integration */

note

If you choose to automatically vault a customer's new payment method, verifications for those payment methods will not include device data when they are evaluated by our Premium Fraud Management Tools. Subsequent transactions can still pass device data.

PayPal

If you're also accepting PayPal using the Vault flow, you can simultaneously collect that device data by adding a paypal option to your dataCollector. See the PayPal Vault guide for details.

Kount Custom integration

availability

We are no longer offering Kount Custom to new merchants. If you wish to deter fraud with an integrated, enterprise-grade risk management solution, you can refer to our Fraud Protection Advanced product.

To use your own Kount merchant ID for fraud detection, pass it in as an additional dataCollector.kount.merchantId parameter in your braintree.setup call:

JavaScript
braintree.setup(CLIENT_AUTHORIZATION, 'custom', {
  dataCollector: {
    kount: {
      environment: 'sandbox',
      merchantId: 'my-custom-kount-id'
    }
  },
  onReady: function (braintreeInstance) {
    braintreeInstance.deviceData;
  }
  /* ... */
});

Creating orders on behalf of customers

Kount will flag multiple orders from the same device if there are multiple card numbers associated with that device. If your customer service reps manually create orders through your normal checkout flow, Kount may identify false positives. This can increase your decline rate.

There are a few ways to prevent false positives when creating multiple orders on the same device:

  • Build a separate checkout flow that doesn’t use device data and make it accessible only to customer service reps (e.g. via a VPN). This prevents Kount from linking and flagging transactions based on device data.
  • Create a rule in your Kount Custom panel to automatically approve transaction created from the Braintree Control Panel, and have customer service reps create transactions in the Braintree Control Panel instead of creating orders via your website.

Contact us for more information.

Next Page: Server-side →