收藏
回答

B2b申请退款有没有SDK?提示参数为空或非法 detail:[支付签名[pay_sig]校验失败

请求地址:https://api.weixin.qq.com/retail/B2b/refund?access_token=84_qGSu4zasllSKLHHITY9QHhxPJhIMj3xG3ooutS8IQ4ZSgesDP1V5nO4oxQa9hMDJfRFclzN5hBOlJc0FUFepZ7i6whawkA0kEzLeYS2DUVtZY2-BRtjyF-5TogQSMBfADALFU&pay_sig=b28d627e8464832b27f9955c76b093969e1c7a9f389d5bd97682aafe271f6ca7

请求数据:{"mchid":"1686022399","out_trade_no":"20240923142431232065","order_id":"o202409231551411832182491","out_refund_no":"r2024092611365718323558","refund_amount":100,"refund_from":1}

响应结果:{"errcode":9403200,"errmsg":"参数为空或非法 detail:[支付签名[pay_sig]校验失败] rid: 66f4d6da-72a6c1db-136fbf81"}

$signData = [
    "mchid" => "1686022399",
    "out_trade_no" => "20240923142431232065",
    "order_id" => "o202409231551411832182491",
    "out_refund_no" => "r2024092611365718323558",
    "refund_amount" => 100,
    "refund_from" => 1
];
$signData = json_encode($signData, JSON_UNESCAPED_UNICODE);
$appKey = "1OQZtyTWw94IUxhhZYPeqxcDuw8voUTN";
$pay_sig = hash_hmac('sha256', 'requestCommonPayment&' . $signData, $appKey);
最后一次编辑于  09-26
回答关注问题邀请回答
收藏

1 个回答

  • 选择
    选择
    09-26

    已处理,uri使用错误导致,感谢各位大佬的关注。

    09-26
    有用
    回复 1
    • 对方正在输入...
      对方正在输入...
      10-11
      你好怎么解决的,看了你的代码,我按照你的写的也不行
      10-11
      回复
登录 后发表内容