0.0.5 • Published 10 months ago

@keabank/websdk v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Set up frontend integration

Install the NPM package.

npm i @keabank/websdk

Import the WidgetSDK module.

import { WidgetSDK } from '@keabank/websdk';

Initialize the integration

const sdk = new WidgetSDK({
  integrationId: 'your_integration_id',
  merchantId: 'your_merchant_id',
});

Open a modal with payment instructions

// Payment parameters
const paymentConfig = {
  amount: 100,
  orderId: 'order_123456',
  paymentPurpose: 'Purchase of digital goods',
  currency: 'USDT_TRC20',
  defaultTheme: 'LIGHT', // LIGHT or DARK default theme is LIGHT
};

// Initialize the payment
const paymentStatus = sdk.init(paymentConfig);

// retrieve transaction status
paymentStatus.then(status => {
  //  success, cancel, instanceof Error
  if (status === 'success') {
    console.log('Payment success');
  }
});

Close the modal dialog

sdk.destroy();
0.0.5

10 months ago

0.0.5-dev.0

11 months ago

0.0.4

12 months ago

0.0.2-dev.0

12 months ago

0.1.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago