Device Fingerprint SDK

Este SDK genera client-side todos los fingerprints asociados a los proveedores que va a usar el comercio.

Generación del DEUNA FraudID

Este script genera un base64 encoded fraudIdque contiene todos los device fingerprints de los proveedores de pago y fraude que el comercio va a usar. De esta manera, el comercio no tiene que incluir cada unos de los SDKs de sus proveedores y tener lógica para recolectar cada uno de ellos y mandarlos a DEUNA.

var script = document.createElement('script');
script.id = 'deuna-cdl';
script.src = 'https://cdn.getduna.com/cdl/index.js';

var loadScript = function () {
  var cdl = DeunaCDL();
  cdl
    .configure({
      apiKey: '<public API Key of DEUNA>',
      // use "production" for sandbox and production
      env:  '<environment name>', // 'production'
      // key / value where the key is the name of the provider and the value is an object
      // with the data required to generate the fingerprint with given provider.
      fraudConfig: {
        MERCADOPAGO: {}, // for MP is empty object
      },
    })
    .then(function () {
      const deviceId = cdl.getFraudId(); //"eyJoZWxsbyI6IndvcmxkIn0="
      // just an example on how the merchant will do the /purchase API call
      fetch(
        '{{base_url}}/merchants/transactions/purchase',
        { method: 'POST', ... },
        {
          body: JSON.stringify(data),
        }
      );
    });
};
script.onload = loadScript; // Up to the merchant where to initialize this script
document.body.appendChild(script);

Donde mandar el fraudID generado

Este fraudIddebe ser enviado en el /purchaseAPI.

  1. En el /purchase V2 se debe mandar en el body:
    1. {
        ...,
        "anti_fraud_info": {
          "device": {
            "fingerprint": "<add here the fraudID>"
          }
        },
        ...
      }
      
  2. En el /purchase V1 se debe mandar en:
    1. {
        ...,
        "device_id": "<add here the fraudID>"
        ...
      }
      

Proveedores de pagos y motores antifraude disponibles para configurar

Puedes consultar el siguiente enlace en donde puedes revisar los proveedores de antifraude soportados con DEUNA. Además te entregamos una tabla con todos los atributos soportados para cada una de las opciones de motores antifraude que soporta el widget

NombreAtributosEjemplo
SIGNIFYDNo requiere parámetros a nivel merchant_idfraudCredentials: { SIGNIFYD: {} }
SIFTaccountId, restApiKeyfraudCredentials: { SIFT: { accountId: '', restApiKey: '' } }
CLEARSALEClientIdfraudCredentials: { CLEARSALE: { clientId: '' } }
CLEARSALE-BRASILClientIdfraudCredentials: { CLEARSALE-BRASIL: { clientId: '' } }
CYBERSOURCEorgId, merchantIdfraudCredentials: { CYBERSOURCE: { orgId: '', merchantId: '' } }the orgId must be always 1snn5n9w for TEST and k8vif92e for PRODUCTION
STRIPEAPI_KEYfraudCredentials: { STRIPE: { apiKey: '' } }
MERCADOPAGO// No requiere parámetros a nivel merchant_idfraudCredentials: { MERCADOPAGO: {} }
BAZorgId, merchantIdfraudCredentials: { BAZ: { orgId: '', merchantId: '' } }