Skip to main content
Device Fingerprint

The EBANX Device Fingerprint feature is designed to enhance payment security by collecting unique device information during a transaction. It works by generating a unique device identifier (or device ID) based on various attributes such as browser type, operating system, and device hardware. This device ID is then submitted along with the payment request to help identify and prevent fraudulent activities. This page outlines how to generate a device ID using the EBANX.js library.

Features

  1. Enhanced Fraud Detection - The device fingerprint allows for in-depth analysis of the user’s device, helping EBANX detect anomalies or patterns often associated with fraudulent behavior. This feature aids in identifying potential fraud before a transaction is completed.
  2. Transparent User Experience - The fingerprinting process occurs in the background, without interrupting or inconveniencing the customer. This ensures the checkout process remains smooth while still adding an extra layer of security.
  3. Seamless Integration - As a developer, integrating the EBANX Device Fingerprint into your payment flow is straightforward when using EBANX.js. Once implemented, the device fingerprint is automatically generated and included in every payment request.
  4. Improved Risk Assessment - The unique device ID, when combined with other transaction data, enables EBANX’s anti-fraud systems to perform more accurate risk assessments, minimizing chargebacks and unauthorized transactions.

Requirements

  • Credentials - Ensure you have your EBANX.js Public Integration Key, which can be found in your EBANX Dashboard. If you don't have it, complete the Merchant Signup Form.

Instructions

To create a device id and add it to your payment request, follow the steps below:

  1. Install EBANX.js

    Insert script tag

    Add the following to your HTML.

    <script src="https://ebanx-js.ebanx.com/latest/dist/ebanx.min.js"></script>

    EBANX recommends integrating the EBANX.js script directly on your checkout page for seamless functionality.


    Initialize

    Include the following function in your JavaScript.

    EBANX.init({
    publicIntegrationKey: '{your_public_integration_key}',
    country: '{country_code_here}',
    mode: 'test',
    });

    Initialization parameters

    FieldDescription
    publicIntegrationKeyMerchant's public integration key
    countryCustomer country code.
    2-digit String
    International standard - ISO 3166-1 alpha-2
    modetest or production
  2. Get device ID

    Call the EBANX.deviceFingerprint.getSession method.

    try {
    let session = await EBANX.deviceFingerprint.getSession();
    // use session to fulfill payment
    } catch(error) {
    // handle errors
    }

    The EBANX.js collection process is unobtrusive and seamlessly integrates without disrupting your webpage’s functionality or user experience.


    EBANX.deviceFingerprint.getSession returns a Promise.

    // Session object
    {
    device_id: 'd7465b1f6b1aaeeab1771fe743e02f34';
    }
  3. Add device ID to Direct API payment request

    Use the EBANX Direct API to create a payment request.

    Include the token from previous step to the payment object in your API call.

    curl -X POST \
    --location 'https://sandbox.ebanx.com/ws/direct' \
    --header 'Content-Type: application/json' \
    --data '{
    "integration_key": "your_test_integration_key",
    "operation": "request",
    "payment": {
    "name": "José Silva",
    "email": "jose@example.com",
    "birth_date": "12/04/1979",
    "document": "853.513.468-93",
    "address": "Rua E",
    "street_number": "1040",
    "city": "Maracanaú",
    "state": "CE",
    "zipcode": "61919-230",
    "country": "br",
    "phone_number": "8522847035",
    "payment_type_code": "visa",
    "merchant_payment_code": "3d1e73b0bbe",
    "currency_code": "BRL",
    "instalments": 1,
    "device_id": "d7465b1f6b1aaeeab1771fe743e02f34",
    "amount_total": 100,
    "creditcard": {
    "card_number": "4111111111111111",
    "card_name": "José Silva",
    "card_due_date": "12/2019",
    "card_cvv": "123"
    }
    }
    }'
  4. Congratulations!

    You have succesfully created a Device Fingerprint using EBANX.js.


Resources

Use the following resources when testing in Sandbox Mode. All transactions in sandbox mode simulate real transactions, but no actual funds are moved.


Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: