f.js library wraps around each of
these, allowing focus on the preferred anti-fraud service.
If using Embed or one of the e-commerce plugins, then none of the steps below are necessary. Embed automatically loads the
right library and ensures the device fingerprint is collected.
Usage without Embed
To create a device fingerprint, load thef.js library into your checkout page. This
can be the page on which you render your checkout using Secure Fields, or any other integration.
In a sandbox environment make sure you use
api.sandbox.{instance_id} .gr4vy.app/f.js.window.gr4vyAntiFraud.f. This fingerprint can then be sent
as the anti_fraud_fingerprint property when creating a transaction.
Embed, e-commerce, and custom
When using Embed, or one of the e-commerce plugins like Magento, then the device fingerprint is automatically created and sent along when creating a transaction. This behavior can be overridden by sending in a custom fingerprint to Embed. For example, if the anti-fraud service in use is known, and that service’s fingerprint script has already been loaded, then the fingerprint created by that service can be passed directly to Embed or the API. When theantiFraudFingerprint value is set, the device fingerprint libraries are not loaded and, instead,
the fingerprint provided is passed along as-is when creating a transaction.
For most anti-fraud services the
fingerprint represents either the session
ID or device fingerprint ID defined by that service’s anti-fraud library.
Please refer to the documentation of your anti-fraud service for more details.Custom & native fingerprints
In the event the automated solution cannot be used to generate the device fingerprint, use the anti-fraud fingerprint libraries directly and then pass the fingerprint by using theanti_fraud_fingerprint when creating a new transaction.
Merchant accounts
In an environment with multiple merchant accounts it’s important to add themerchant_account_id as a query
parameter to the fingerprint script. This ensures the script is loaded for the Primary anti-fraud service for
that specific merchant account.
merchantAccountId needs to be set
explicitly for Embed to load the anti-fraud scripts for that merchant account.