You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

request-payment.js 982B

1234567891011121314151617181920212223
  1. /*
  2. * @Author: gaorf30153 gaorf30153@hundsun.com
  3. * @Date: 2024-06-26 08:41:43
  4. * @LastEditors: gaorf30153 gaorf30153@hundsun.com
  5. * @LastEditTime: 2024-06-26 08:59:33
  6. * @FilePath: \wxminipro\miniprogram\functional-pages\request-payment.js
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. exports.beforeRequestPayment = function (paymentArgs, callback) {
  10. // 自定义的参数,此处应为从插件传递过来的 paymentArgs
  11. console.log(paymentArgs)
  12. var error = null
  13. var requestPaymentArgs = {
  14. //该对象为下单所需参数,以后端接口返回的为准!!
  15. timeStamp: paymentArgs.timeStamp,
  16. nonceStr: paymentArgs.nonceStr,
  17. package: paymentArgs.package,
  18. signType: paymentArgs.signType,
  19. paySign: paymentArgs.paySign,
  20. }
  21. callback(error, requestPaymentArgs) //重点:返回requestPaymentArgs
  22. console.log(requestPaymentArgs)
  23. }