next
tag is applied in version 1.0.0
+, which is not automatically fetched by npm when running npm install knotapi-js
.
open
method:
Name | Type | Description |
---|---|---|
sessionId | String | The session created by calling /session/create in your backend. |
clientId | String | Your organization’s client ID. Note that this varies between development and production environments. |
environment | Environment | The desired environment (development or production ). |
product | Product | The Knot product the session will inherit - the same as the type of session created. E.g. card_switcher or transaction_link . |
merchantIds | [int]? | Optional when product = card_switcher. Required when product = transaction_link. A list of merchant ID(s) to display. It is recommended to provide 0 or 1 merchant IDs depending on your desired user experience. |
entryPoint | String? | Optional. The specific entry point from within your app where you are initializing the Knot SDK (e.g. onboarding ). |
useCategories | Boolean | Optional. Whether to display merchant categories and therefore group merchants into categories for discoverability. Default: true . |
useSearch | Boolean | Optional. Whether to display the search bar, enabling users to search for merchants. Default: true . |
onError
callback. To take advantage of this functionality, please contact the Knot team who will be happy to assist you.Name | Type | Description |
---|---|---|
cardName | String | Optional. The differentiated display name for the card product, used inside the Knot SDK (e.g. Debit Card , Credit Card ). This value will override the default value Card . |
customerName | String | Optional. The differentiated display name for the company, used both as a standalone and prepended to the cardName (e.g. Smart Bank , Payment Corp ). This value will override your default customer name value. Only recommended if you issue cards under multiple brands. |
logoId | String | Optional. The differentiated logo for the company. This value will override your default logo. |
cardName
and customerName
parameters are used together in text inside the Knot SDK: "Your [customerName] [cardName | Card] was added."
open
method with the parameters like below:
KnotConfiguration
. More in Retrieving & Listing Merchants. The merchant ID is the same across all environments.
AUTHENTICATED
webhook.
useCategories: false
and useSearch: false
when initializing the SDK. This is not recommended.
open
method provides several callbacks you can use to receive events from the SDK.
onSuccess
product
and details
, the latter of which contains the merchantName
field, representing the merchant for which the card was updated.
onError
product
, errorCode
, and errorDescription
.
errorCode | errorDescription |
---|---|
INVALID_SESSION | The session ID is invalid. |
EXPIRED_SESSION | The session has expired. |
INVALID_CLIENT_ID | The client ID is invalid. |
INVALID_MERCHANT_ID | The merchant ID is required when product type = transaction_link. |
INVALID_CARD_NAME | The card name is invalid. |
INVALID_CUSTOMER_NAME | The customer name is invalid. |
INVALID_LOGO_ID | The logo ID is invalid. |
onExit
onEvent
product
, event
, merchant
, merchantId
, payload
, and taskId
.
event
property:
Event | Description |
---|---|
REFRESH_SESSION_REQUEST | Emitted when the session used to initialize the SDK needs to be refreshed. |
MERCHANT_CLICKED | Emitted when a user clicks on a merchant from the merchant list. |
LOGIN_STARTED | Emitted when a user submits their credentials to login to the merchant. |
AUTHENTICATED | Emitted when a user successfully logs in to the merchant. |
OTP_REQUIRED | Emitted when a user needs to enter an OTP code to login to the merchant. |
QUESTIONS_REQUIRED | Emitted when a user needs to enter answers to security questions to login to the merchant. |
APPROVAL_REQUIRED | Emitted when a user needs to approve the login - often via a push notification or directly in the merchant’s mobile app - to login to the merchant. |
ZIPCODE_REQUIRED | Emitted when a user needs to enter their zip code to login to the merchant. |
LICENSE_REQUIRED | Emitted when a user needs to enter their drivers license to login to the merchant. |