Merchant SDK
Merchant SDK for
Node
Install
npm i @cqmbr/merchant-node-sdk
Usage
const { PrePayHttpRequest, PayCallback, WithdrawCallback, MerchantCoinRequest, TransactionRequest } = require('@cqmbr/merchant-node-sdk')
// 预支付
const prePayHttpRequest = new PrePayHttpRequest()
const prePayRes = async prePayHttpRequest.sendPrePay(requestBody, merchantPrivateKey, mbrPublicKey)
// 支付回调
const payCallbackData = PayCallback.httpPayCallback(requestString, merchantPrivateKey, mbrPublicKey)
// 提现回调
const withdrawCallbackData = WithdrawCallback.httpWithdrawCallback(requestString, merchantPrivateKey, mbrPublicKey)
// 获取当前商户币种列表
const merchantCoinRequest = new MerchantCoinRequest()
const coinList = async merchantCoinRequest.queryCoinList(merchantId, merchantPrivateKey, mbrPublicKey)
// 提现
const transactionRequest = new TransactionRequest()
const withdrawRes = async transactionRequest.withdraw(withDrawParams, merchantPrivateKey, mbrPublicKey)