收藏
回答

requestPluginPayment发起支付一直报订单已过期?

requestPluginPayment发起调用,拉起支付功能页之后,点击支付一直报订单已过期,

// 插件内支付调用
wx.requestPluginPayment({
      version: 'develop',
      fee: 1,
      paymentArgs: {
        timeStamp: "1701853617",
        nonceStr: "4a0726bb511e493d93ff1f28e1df9f0f",
        package: "prepay_id=wx06170657836361933fdfaa88381a2f0000",
        signType: 'RSA',
        paySign: "myOu9pxNWGoaPunIcBWqlPKFuAWeBP2HC66vyK+nISynunQtqMwfMhLTfu8SnN1P4dlxGmAFQFo1vtFTYszhU7CW6B/kohJckfZ7gDX75ON/j3nzzy7bbhkJ+KsNcqaluJ9dDHlFYJC3j+fBp0RoXQJKEeGTgp5qcLZSSnRDXYLcCgp4IMsxt9j6HDmdaLzKO4m9dI6bPcS1ZeogC9CUmxVQtewdkIS3Vk5GaDVmZZbjYwroBDKfPVn5kKqQ9bzcGiZEaSPUisKPd/P1cHr+JsQ2bEWnOb/ViuOIsaxl/uhVjl3RH3fpLM7w+DvNXhC5JO59ohU23ch/pSUaOOsa6g==",
      },
      currencyType: 'CNY',
      success (res) { 
        console.log(res)
      },
      fail (res) { 
        console.log(res);
      }
    })


宿主小程序的支付功能页函数
exports.beforeRequestPayment = function (paymentArgs, callback) {
  console.log('paymentArgs',paymentArgs);
      var requestPaymentArgs = {
        timeStamp: paymentArgs.timeStamp,
        nonceStr: paymentArgs.nonceStr,
        package: paymentArgs.package,
        signType: paymentArgs.signType,
        paySign: paymentArgs.paySign,
      };
      callback(null, requestPaymentArgs)
  //
}
ddiao
回答关注问题邀请回答
收藏

1 个回答

  • 胡β
    胡β
    2023-12-06
    timeStamp: "1701853617",
            nonceStr: "4a0726bb511e493d93ff1f28e1df9f0f",
            package: "prepay_id=wx06170657836361933fdfaa88381a2f0000",
    

    不应该都是实时获取的吗?

    2023-12-06
    有用
    回复 1
    • 杨虎
      杨虎
      2023-12-06
      这个是我跑接口之后直接填入的,而且直接在宿主小程序内使用以上参数,调用requestPayment是没问题的
      2023-12-06
      回复
登录 后发表内容