<script> tag and use the three methods below to initialize, mount, and respond to the hosted account capture flow.
Methods
IngoInstantPayments.create(domElement, options?)
Creates an instance of the SDK and attaches it to a DOM element in your page. Returns a webPlugin object that exposes the mount and addEventListener methods.
Arguments
| Argument | Required | Type | Description |
|---|---|---|---|
domElement | Yes | Element or string | The DOM element or CSS selector where the iFrame will be injected (e.g. document.getElementById("container") or "#container"). |
options | No | Object | Initialization options (see below). |
| Option | Type | Default | Description |
|---|---|---|---|
cssName | string | — | A CSS class name to add to the iFrame element. |
autoHeight | boolean | false | When true, the iFrame height adjusts automatically as its content changes or the window is resized. |
scrolling | boolean | false | Enables or disables the iFrame’s default scroll bars. |
webPlugin.mount(authorizedUrl, fundingDestination)
Mounts the iFrame and launches the account capture flow for the specified funding destination. Must be called after create().
Arguments
| Argument | Required | Type | Description |
|---|---|---|---|
authorizedUrl | Yes | string | The authorized_url returned from the Session Create API. Valid for 30 seconds after creation. |
fundingDestination | Yes | Constant | The account type to tokenize. Must be a valid IngoInstantPayments.FUNDING_DESTINATIONS value. |
FUNDING_DESTINATIONS constants
| Constant | Payment Type |
|---|---|
IngoInstantPayments.FUNDING_DESTINATIONS.DEBIT | Debit card |
IngoInstantPayments.FUNDING_DESTINATIONS.CREDIT | Credit card |
IngoInstantPayments.FUNDING_DESTINATIONS.ACH | Bank account (ACH) |
IngoInstantPayments.FUNDING_DESTINATIONS.BILLPAY | BillPay |
IngoInstantPayments.FUNDING_DESTINATIONS.PAYPAL | PayPal |
webPlugin.addEventListener(event, handler)
Registers a callback function for a specific SDK event. This is the only way to receive data from the iFrame. Register listeners before or immediately after calling mount().
Arguments
| Argument | Required | Type | Description |
|---|---|---|---|
event | Yes | Constant | The event to listen for. Must be a valid IngoInstantPayments.EVENTS value. |
handler | Yes | function | Callback invoked when the event fires. Receives an event data object. |
| Field | Description |
|---|---|
session_identifier | Unique identifier for the current session. |
tracer_token | Token used for debugging across systems. |
event_name | Name of the event fired (e.g. iip.webplugin.token_success). |