@keabank/websdk
v0.0.5
Published
KeaBank WebSdk React
Downloads
19
Readme
Set up frontend integration
Install the NPM package.
npm i @keabank/websdkImport 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();