Skip to content

Latest commit

ย 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘› 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

  1. Get timestamp from header WalletPay-Timestamp
  2. Get signature from header Walletpay-Signature
  3. Get body from request body
walletPay.verifyWebhook(timestamp, signature, body) // return boolean

About

๐Ÿ‘› Wallet Pay (Telegram) SDK

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages