3***@qq.com
3***@qq.com
  • 发布:2024-08-13 23:10
  • 更新:2024-12-19 16:33
  • 阅读:178

unipay refund退款使用问题

分类:uniCloud

小白请教问题,使用uni pay中的下面函数,退款,结果报错说没有权限。查了以下文档,应该是要uni-id中需要设置权限。但是,并没有设置权限的教程。网上查找也没有解决方法。希望大神出一个手把手教学的教程。

let res = await this.$refs.pay.refund({
out_trade_no: this.orderMangeItem.outTradeNo, // 插件支付单号
});

2024-08-13 23:10 负责人:无 分享
已邀请:
DCloud_uniCloud_VK

DCloud_uniCloud_VK

报错信息截图看下

  • 3***@qq.com (作者)

    感谢回答!我看uni pay的部分代码找到解决方案了。设置了用户权限,但是还需要获取新的tocken,才可以获得最新的用户权限。但是,又遇到其他问题。


    16:55:50.668 [本地调试]Error: unsupported, POST https://api.mch.weixin.qq.com/secapi/pay/refund -1 (connected: false, keepalive socket: false, socketHandledRequests: 0, socketHandledResponses: 0) uni_modules/uni-pay/uniCloud/cloudfunctions/uni-pay-co/service/pay.js:608:11

    16:55:50.668 [本地调试]headers: {}

    16:55:50.669 [本地调试] at configSecureContext (node:internal/tls/secure-context:281:15)

    16:55:50.669 [本地调试] at Object.createSecureContext (node:_tls_common:117:3)

    16:55:50.669 [本地调试] at Object.connect (node:_tls_wrap:1750:48)

    16:55:50.670 [本地调试] at Agent.createConnection (node:https:158:22)

    16:55:50.670 [本地调试] at Agent.createSocket (node:_http_agent:341:26)

    16:55:50.670 [本地调试] at Agent.addRequest (node:_http_agent:288:10)

    16:55:50.671 [本地调试] at new ClientRequest (node:_http_client:342:16)

    16:55:50.671 [本地调试] at Object.request (node:https:366:10)


    证书都配置好了,用的是 v2。目前没有找到解决方案

    2024-08-15 23:57

  • DCloud_uniCloud_VK

    回复 3***@qq.com: 改成v3,目前node18不支持v2版本的微信支付的退款API了,因为p12证书的格式被node18废弃了

    2024-08-16 11:10

  • 3***@qq.com (作者)

    回复 DCloud_uniCloud_VK: 好的,十分感谢

    2024-08-16 22:29

3***@qq.com

3***@qq.com (作者)

感谢回答!我看uni pay的部分代码找到解决方案了。设置了用户权限,但是还需要获取新的tocken,才可以获得最新的用户权限。但是,又遇到其他问题。

16:55:50.668 [本地调试]Error: unsupported, POST https://api.mch.weixin.qq.com/secapi/pay/refund -1 (connected: false, keepalive socket: false, socketHandledRequests: 0, socketHandledResponses: 0) uni_modules/uni-pay/uniCloud/cloudfunctions/uni-pay-co/service/pay.js:608:11
16:55:50.668 [本地调试]headers: {}
16:55:50.669 [本地调试] at configSecureContext (node:internal/tls/secure-context:281:15)
16:55:50.669 [本地调试] at Object.createSecureContext (node:_tls_common:117:3)
16:55:50.669 [本地调试] at Object.connect (node:_tls_wrap:1750:48)
16:55:50.670 [本地调试] at Agent.createConnection (node:https:158:22)
16:55:50.670 [本地调试] at Agent.createSocket (node:_http_agent:341:26)
16:55:50.670 [本地调试] at Agent.addRequest (node:_http_agent:288:10)
16:55:50.671 [本地调试] at new ClientRequest (node:_http_client:342:16)
16:55:50.671 [本地调试] at Object.request (node:https:366:10)

证书都配置好了,用的是 v2。目前没有找到解决方案

2***@qq.com

2***@qq.com

我的用户体系没用uni-id,可以修改下面文件的内容 uni-pay-co/config/permission.js

要回复问题请先登录注册