zoujingli / WeChatDeveloper

【新】微信服务号+微信小程序+微信支付+支付宝支付
https://www.kancloud.cn/zoujingli/wechat-developer/content
MIT License
1.49k stars 444 forks source link

H5微信支付退款 报 输入源“/body/sub_mchid”映射到字段“二级商户号”必填性规则校验失败,此字段为必填项 #76

Closed 858864436 closed 1 year ago

858864436 commented 2 years ago

$data = [ 'sub_mchid' => array_get($wxPayConf, 'mch_id'), 'sp_appid' => array_get($wxPayConf, 'appid'), 'transaction_id' => 'xxxxx', 'out_trade_no' => 'xxxxxx', 'out_refund_no' => 'TEST_REFUND' . time(), 'amount' => [ 'refund' => 1, 'total' => 5, 'currency' => 'CNY', ], ]; $wechat = \WePayV3\Refund::instance($wxPayConf); $result = $wechat->create($data);

报错 Array ( [code] => PARAM_ERROR [message] => 普通商户不允许传sub_mch_id )

H5微信支付申请退款官方文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_9.shtml 请求URL:https://api.mch.weixin.qq.com/v3/refund/domestic/refunds

你们请求URL: https://api.mch.weixin.qq.com/v3/ecommerce/refunds/apply

我将请求地址换成 https://api.mch.weixin.qq.com/v3/refund/domestic/refunds 参数按照官方文档要求, 退款成功。

麻烦作者帮我看看, 谢谢。

yao978318542 commented 1 year ago

估计作者不维护这个项目了吧,好几个地方有问题

zoujingli commented 1 year ago

普通商户应该没有问题才对,目前不支持服务商,主要是因为没有此类测试账号进行调试。

zoujingli commented 1 year ago

已完善直连商户接口