QQ 小程序虚拟支付(米大师)
yarn add qq-mini-pay
import { MiniPay } from 'qq-mini-pay'
const miniPay = new MiniPay({
appId: '',
appKey: '',
offerId: '',
async getAccessToken() {
return ''
},
sandbox: false,
retryLimit: 3,
http2: true,
})
const user = {
openId: '',
sessionKey: '',
zoneId: '',
}
miniPay.pay(user, {
amt: 1,
userIp: '',
payItem: '',
appRemark: '',
})
miniPay.getBalance(user)
miniPay.present(user, {
presentCounts: 1,
userIp: '',
})