feat(M08-A): 接入顾客端权益明细
This commit is contained in:
@@ -64,6 +64,24 @@ function clientRequestId(prefix) {
|
||||
return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`
|
||||
}
|
||||
|
||||
function requestWechatPayment(params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!params || !params.timeStamp || !params.nonceStr || !params.package || !params.paySign) {
|
||||
reject(new Error('微信支付参数不完整'))
|
||||
return
|
||||
}
|
||||
wx.requestPayment({
|
||||
timeStamp: String(params.timeStamp),
|
||||
nonceStr: params.nonceStr,
|
||||
package: params.package,
|
||||
signType: params.signType || 'RSA',
|
||||
paySign: params.paySign,
|
||||
success: resolve,
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
request,
|
||||
login,
|
||||
@@ -71,4 +89,5 @@ module.exports = {
|
||||
clearSession,
|
||||
cents,
|
||||
clientRequestId,
|
||||
requestWechatPayment,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user