- V3统一下单二次签名nodejs云函数简单代码
得到prepay_id后,小程序支付二次签名: function getPayment(prepay_id){ let wxContext = cloud.getWXContext() let appid = wxContext.APPID let package = 'prepay_id=' + prepay_id let timestamp = parseInt(Date.now() / 1000) + '' let nonce_str = Math.random().toString(36).substr(2, 15) return { appId: appid, nonceStr: nonce_str, package, signType: 'RSA', timeStamp: timestamp, paySign: getSign([appid, timestamp, nonce_str, package], key) } } function getSign(parts = [], key, str = '') { parts.forEach(v => str += v + '\n') return crypto.createSign('RSA-SHA256').update(str).sign(key, 'base64') }
2021-12-17 - 作为服务商,我在为特约商户APPID配置的时候,支付这块怎么处理?
作为服务商,我在为特约商户APPID配置的时候,这里提示要传入特约商户对应类型的APPID; 那么在服务商发起JSAPI支付的时候,这个APPid应该放哪个位置呢? 我放在子商户应用ID(sub_appid)上的时候后,下单的时候提示 “appid和mch_id不匹配”; [图片] [图片]
2022-02-08