1.0.13 • Published 1 year ago

wallet-pay-sdk-ts v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

👛 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
1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago