Plain HTML integration
To integrate the Widget, include the Fintoc script in your HTML page. Include the script on each page where you use the Widget.window.onloadRemember that, when importing a JavaScript
script, if you try to use functions before the browser loads the script, an error will be raised. You can solve this by using the native browser event window.onload.ES module integration
You can also use the Widget as an ES module throughnpm with the @fintoc/fintoc-js library.
getFintoc method that returns the Fintoc object.
Methods of the Widget object
Once you create a Widget object, you can use its methods to interact with it. The available methods areopen, hide, and destroy.
How to use the
widget.destroy() methodCalling Fintoc.create(args) embeds an iframe in your application. When you develop a single-page application (SPA), you may need to remove this iframe. The destroy method removes it. To re-open the Widget afterward, create a new instance with Fintoc.create(args).How to set up and deploy the Widget
Each product sets up and deploys the Widget on your front end differently. Including the Fintocscript in your application (or calling the getFintoc method of the @fintoc/fintoc-js library) exposes the Fintoc class. The Fintoc class creates connections to a financial institution from your application.
Raise the WidgetCall
.open() to open the Widget.Payment Initiation
Javascript
Movements
Javascript
Direct Debit
Javascript
Use the Widget callbacks and events correctlyNever use the
onSuccess, onExit, or onEvent callbacks to read the state of the resource being created. Use these callbacks only to drive your frontend flow while you wait for backend confirmation, either through webhooks or by exchanging a confirmation token. You can also use frontend events to generate Widget usage metrics. Never rely on frontend events alone to assume a resource was created or failed to be created.Dark mode for the Widget appearanceSend the
appearance parameter to set the Widget color scheme to light or dark mode.Username and holderId objects
To pre-fillusername or holderId and override the defaults, send an object with these attributes:
Pre-filling raises payment conversionIn Fintocโs internal testing, pre-filling the username raised payment conversion by 3%.