Add Maven Central
build.gradle
file ensures that the Android Gradle plugin (and all other dependencies) are properly resolved and kept up-to-date.Add the Knot SDK to your app
app/build.gradle
), configure your Android settings-such as the minimum SDK version and Java 8 support-to ensure compatibility with the SDK. The Knot SDK Requires Android API level 21
or greater.Include the Knot SDK dependency
<latest-version>
with the current version provided by Knot.Import Knot SDK
KnotConfiguration
class. The configuration allows you to set the environment, entry point, and other user experience configurations.
KnotConfiguration
and CustomerConfiguration
classes are used to initialize the SDK with specific parameters.
KnotConfiguration
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 | Optional. Ignored in version 2.0.12+ and fully deprecated in the next major version. The Knot product the session will inherit — the same as the type of session created (e.g. card_switcher , transaction_link ). |
merchantIds | int[] | Optional. A list of merchant ID(s) to display. It is recommended to provide 0 or 1 merchant IDs depending on your desired user experience. |
useCategories | Bool | Optional. Whether to display merchant categories and therefore group merchants into categories for discoverability. Default: true . |
useSearch | Bool | Optional. Whether to display the search bar, enabling users to search for merchants. Default: true . |
domainUrls | String[] | Optional. A set of domains for which Knot should explicitly not clear cookies. |
entryPoint | String | Optional. The specific entry point from within your app where you are initializing the Knot SDK (e.g. onboarding ). |
CustomerConfiguration
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. |
"Your [customerName] [cardName | Card] was added."
open
method with a context
, a KnotConfiguration
instance, and an optional KnotEventDelegate
.
KnotConfiguration.
If a single merchant ID is provided, the user will be sent directly to that merchant’s login experience in the SDK. More in Retrieving & Listing Merchants. The merchant ID is the same across all environments.
KnotConfiguration
. This value will be returned in the AUTHENTICATED
webhook.
useCategories: false
and useSearch: false
in KnotConfiguration
. This is not recommended.
KnotEventDelegate
in your class.
onSuccess
onError
KnotError
enum with four possible cases, as described below.
Error Case | Description |
---|---|
INVALID_SESSION | The session is invalid. |
EXPIRED_SESSION | The session has expired. |
INVALID_CLIENT_ID | The client ID is invalid. |
INTERNAL_ERROR | An internal error occurred. |
MERCHANT_ID_NOT_FOUND | The merchant ID is required. |
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
KnotEvent
class as described below.
KnotEvent.event
property.
Name | 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. |
SECURITY_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. |
domainUrls
configuration in KnotConfiguration
. This is uncommon.