You can optionally process the Device Fingerprint service to collect additional details after the user has performed an action, such as after submitting an order or purchase form. Our system allows you to provide an element to bind to as part of an onclick or onsubmit trigger. When the user clicks or submits that element, the Device Fingerprint code will execute and gather the form elements you've specified to perform fraud analysis.
The trigger will override the default action of the element's onclick or onsubmit function, perform IPQS fraud analysis and Device Fingerprinting service, and then execute the original action of the element. For example, suppose you bind the trigger to a form's submit button; our Device Fingerprint script will run first. In that case, it will append the results of our fraud scoring to your form and submit it to your server. The example above shows that setting Startup.FormFieldPrepend will prepend a title to all appended form variables.
If you would like to prevent submitting the form immediately, you can use the Startup.AfterResult() function detailed above. When using the Startup.AfterResult() function, the Device Fingerprint will not append the results to your form. If the service is unable to bind to your supplied trigger, the console log will report errors.
Suppose you prefer to execute code before calling the API during a trigger event. In that case, you can optionally supply a callback function as the second parameter on Startup.Trigger(). It will pass the event object, so you can optionally use preventDefault() or call any other function as needed.