Skip to main content
Embed the Fintoc Widget in a web application with an HTML script tag or an ES module. This page also covers Widget methods, configuration parameters, and callbacks.

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.
Client
window.onloadThe browser raises an error if you call a Fintoc function before the script loads. Use the native window.onload event to wait for the script.

ES module integration

You can also use the @fintoc/fintoc-js library as an ES module through npm.
Client
The library exports the asynchronous getFintoc function. This function returns the Fintoc object.
Client

Methods of the Widget object

After you create a Widget instance, use its open, hide, and destroy methods to control the instance:
How to use the widget.destroy() methodCalling Fintoc.create(args) embeds an iframe in your application. In a single-page application, you may need to remove the iframe. Call widget.destroy() to remove the iframe. To reopen the Widget, create a new instance with Fintoc.create(args).

Configure the Widget

Each product requires different Widget configuration parameters. Loading the Fintoc script gives your application access to the Fintoc object. The getFintoc function from @fintoc/fintoc-js returns the same object. Use Fintoc.create() to create a Widget instance for your product.
Open the WidgetCall widget.open() to open the Widget.

Payment initiation

Client

Movements

Client

Direct debit

Client
Configure the Widget with these parameters:
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. Confirm the resource 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 determine whether resource creation succeeded or failed.
Dark mode for the Widget appearanceSend appearance to set the Widget color scheme to light or dark.

username and holderId objects

To pre-fill username or holderId and override the defaults, send an object with these attributes:
Client
Pre-filling increases payment conversionIn Fintoc’s internal testing, pre-filling the username raised payment conversion by 3%.
The username and holderId objects support these attributes: