支付(huazhuliren)(Payment (huazhuliren))

export const wxPayment = (option) => { const options = { timeStamp: ”, nonceStr: ”, prepay_id: ”, paySign: ”, …option } return new Promise((resolve, reject) => { // #ifdef APP-PLUS console.log(options,666); let orderInfo ={ appid: options.appid,//微信开放平台appid partnerid: options.partnerid, //商户号 prepayid: options.prepayid, //预支付交易会话ID timestamp: options.timestamp, //时间戳 noncestr: options.noncestr, //随机字符串 package: ‘Sign=WXPay’, //订单详情扩展字符串 sign: options.paySign,//签名 } console.log(orderInfo,665); uni.requestPayment({ provider: ‘wxpay’, orderInfo, success: res => resolve(res), fail: res => reject(res) }) // #endif // #ifdef MP-WEIXIN uni.requestPayment({ provider: ‘wxpay’, timeStamp: options.timeStamp, nonceStr: options.nonceStr, ‘package’: `prepay_id=${options.prepay_id}`, signType: ‘MD5’, paySign: options.paySign, success: res => resolve(res), fail: res => reject(res) }) // #endif

})}

————————

export const wxPayment = (option) => { const options = { timeStamp: ”, nonceStr: ”, prepay_id: ”, paySign: ”, …option } return new Promise((resolve, reject) => { // #ifdef APP-PLUS console.log(options,666); let orderInfo ={ appid: options.appid,//微信开放平台appid partnerid: options.partnerid, //商户号 prepayid: options.prepayid, //预支付交易会话ID timestamp: options.timestamp, //时间戳 noncestr: options.noncestr, //随机字符串 package: ‘Sign=WXPay’, //订单详情扩展字符串 sign: options.paySign,//签名 } console.log(orderInfo,665); uni.requestPayment({ provider: ‘wxpay’, orderInfo, success: res => resolve(res), fail: res => reject(res) }) // #endif // #ifdef MP-WEIXIN uni.requestPayment({ provider: ‘wxpay’, timeStamp: options.timeStamp, nonceStr: options.nonceStr, ‘package’: `prepay_id=${options.prepay_id}`, signType: ‘MD5’, paySign: options.paySign, success: res => resolve(res), fail: res => reject(res) }) // #endif

})}