Premium Fraud Management Tools

Client-Side Implementationanchor

Collecting device dataanchor

DataCollector enables you to collect data about a customer's device and correlate it with a session identifier on your server.

Get the SDKanchor

In your build.gradle, add the following:

  1. Groovy
dependencies {
  compile 'com.braintreepayments.api:data-collector:3.20.1'
}

Initializinganchor

Drop-inanchor

  1. Create a DropInRequest with a tokenization key or client token from your server.
  1. Java
DropInRequest dropInRequest = new DropInRequest()
  .clientToken(clientToken);
  1. Specify true for the device data collection option.
  1. Java
dropInRequest.collectDeviceData(true);
  1. Start the Drop-in activity.
  1. Java
startActivityForResult(dropInRequest.getIntent(this), REQUEST_CODE);
  1. Send the device data string response from Drop-in to your server to be included in verification or transaction requests.
  1. Java
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  if (requestCode == REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
      String deviceData = result.getDeviceData();
    }
  }
}
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.

Customanchor

  1. Initialize a BraintreeFragment with a tokenization key or a client token from your server.

  2. When verifying a card or creating a transaction, call DataCollector#collectDeviceData.

  1. Java
DataCollector.collectDeviceData(braintreeFragment, new BraintreeResponseListener<String>() {
  @Override
  public void onResponse(String deviceData) {
    // send deviceData to your server
  }
});
  1. Send the string response from DataCollector#collectDeviceData to your server to be included in verification or transaction requests.

Next Page: Server-side