wallet-pay-sdk-ts
v1.0.13
Published
👛 Wallet Pay (Telegram) SDK with TypeScript support
Downloads
28
Readme
👛 Wallet Pay (Telegram) SDK
Wallet Pay (Telegram) SDK with TypeScript support
Installation
npm i wallet-pay-sdk-ts
Usage
Initial
import { createWalletPaySDK } from 'wallet-pay-sdk-ts'
const walletPay = createWalletPaySDK('[STORE_API_KEY]', '[WEBHOOK_URI_PATH]')
Create Order
walletPay.create({
amount: {
currencyCode: 'USD',
amount: '1.00',
},
autoConversionCurrency: 'USDT',
description: 'VPN for 1 month',
returnUrl: 'https://t.me/wallet',
failReturnUrl: 'https://t.me/wallet',
customData: 'client_ref=4E89',
externalId: 'ORD-5023-4E89',
timeoutSeconds: 10800,
customerTelegramUserId: 0,
})
Get Order Preview
walletPay.getPreview({ id: '[ORDER_ID]' })
Get Order List
walletPay.getOrderList({ count: 10, offset: 0 })
Get Order Amount
walletPay.getOrderAmount()
Verifying webhook
- Get
timestamp
from headerWalletPay-Timestamp
- Get
signature
from headerWalletpay-Signature
- Get
body
from request body
walletPay.verifyWebhook(timestamp, signature, body) // return boolean