@bancame/widget-js
v0.0.9
Published
Use bancame widget as an ES module
Downloads
190
Readme
Installation
Install using npm
npm install @bancame/widget-jsUsage
This widget supports a single method called getBancameWidget. This is an async method that returns the BancameWidget object described in the Buy Now, Pay Later documentation. In order to get the BancameWidget object, use the following snippet:
import { getBancameWidget } from "@bancame/widget-js";
const BancameWidget = await getBancameWidget();After getting the Bancame widget object, you are ready to create an instance of the widget:
const params = { ... }
const widget = BancameWidget.create(params);Here, params corresponds to an object with the parameters that are sent to the widget. (You can read more about these parameters here)
Finally, you can use any of the widget methods:
widget.open();
widget.close();
widget.destroy();You can read more about these methods here
Quick start guidelines
Quickstart: with pre-evaluation here
Quickstart: without pre-evaluation here
Typescript support
This package includes TypeScript declarations for the Bancame widget.
