Keabank

For developers

Add SDK script

Step 1: Setup the SDK

To integrate the WebSDK you should:

  1. Install the NPM package: npm install @keabank/websdk
  2. Import the WidgetSDK module import { WidgetSDK } from '@keabank/websdk'

Step 2: Initialize the SDK with Merchant IDs

Use the following code to initialize the SDK:

const sdk = new WidgetSDK({
  integrationId: 'your_integration_id',	// Replace with your Integration ID
  merchantId: 'your_merchant_id', 		// Replace with your Merchant ID
});

Step 3: Add a Payment Event

To initiate a payment, use the init method:

const paymentStatus = sdk.init({
  amount: 100,
  orderId: 'order_123456',
  paymentPurpose: 'Purchase of digital goods',
  currency: 'USDT_TRC20',
  defaultTheme: 'dark', // Optional: Set the default theme (light or dark)
});

Parameters:

  1. amount (required, number)
    • The payment amount to be processed.
    • EXAMPLE: 100
  2. orderId (required, string)
    • A unique identifier for the order, linking the payment to a specific transaction or purchase.
    • EXAMPLE: 'order_123456'
  3. paymentPurpose (required, string)
    • A description of the purpose of the payment. It specifies what the payment is for (e.g., the purchase of goods or services).
    • EXAMPLE: 'Purchase of digital goods'
  4. currency (required, string)
    • The currency in which the payment is made.
    • Available values: 'USDT_TRC20' — Tether token on the TRC20 network.
    • EXAMPLE: 'USDT_TRC20'
  5. defaultTheme (optional, 'light' | 'dark')
    • Set the default theme (light or dark)
    • EXAMPLE: ''light''

Step 4: Retrieve Transaction Status

const paymentStatus = sdk.init({
  amount: 100,
  orderId: 'order_123456',
  paymentPurpose: 'Purchase of digital goods',
  currency: 'USDT_TRC20',
});