收藏
回答

v3 支付 退款 直连模式 使用退款 api 接口 报 参数错误

v3 退款接口文档

https://pay.weixin.qq.com/wiki/doc/api/wxpay/ch/fusion_wallet_ch/MiniProgramPay/chapter8_2.shtml#top


参数传的都没用问题

{
    "appid": "wx6d******82",
    "mchid": "1******3261",
    "transaction_id": "42000******724",
    "out_trade_no": "000009",
    "out_refund_no": "aaaaaaaaa",
    "amount": {
        "refund": 1,
        "total": 2,
        "currency": "CNY"
    },
    "reason": "退款测试",
    "notify_url": "https://3da873dd3c62.******/api/or"
}

就是报 参数错误


{
    "code": "PARAM_ERROR",
    "message": "参数格式错误",
    "detail": {
        "field": "#",
        "issue": "缺少必填字段",
        "location": "body"
    }
}
回答关注问题邀请回答
收藏

2 个回答

  • 阿白
    阿白
    2020-11-12
    POST /hk/v3/refunds HTTP/1.1
    Authorization: WECHATPAY2-SHA256-RSA2048 mchid="1556223261",serial_no="443A8CDE502393C8CB686A8FB51680297F7AF902",nonce_str="1605163643553",timestamp="1605163644",signature="sVn50tYrLZX+OUe0pyjmYbNjwTa95VCi5Qv7U8zLVuoS5BariEUsH07AXr3hXxf2TFjMVeEaCcCiqOoZNPX4fFaEp7c1jxaHPkV5BkW6qifRnZWgSh1VCXuCXspE8fxXsmKnXufMizkS+O7oQdWuIgJ7WMhwhGtSuAqx9F4Kvc9N6/C5EYIg0KOhUTMzz4yvCEZG1VKBOBJKMx7LZzVxThauuEiTfgqUYNgC8jYNQSkOpd4Lc3qrHLNmvdO97KRAse3Dm5grWcYS4vWAp3U7VVaprsGFsXsj0dZzQbKfcXCE5ZvCh91uZQ/Emw7ckVmb6/X1jWw3FsQXZY66wCZ6GA=="
    Content-Type: application/json
    User-Agent: PostmanRuntime/7.26.8
    Accept: */*
    Postman-Token: d26dc18f-18c2-411f-a43c-2ef0017471c9
    Host: api.mch.weixin.qq.com
    Accept-Encoding: gzip, deflate, br
    Connection: keep-alive
    Content-Length: 386"appid": "wx61c7d3b8584331a2""mchid": "1556223261""transaction_id": "4200000737202011104173724549""out_trade_no": "000009""out_refund_no": "aaaaaaaaa""amount": { 
    "refund": 1, 
    "total": 2, 
    "currency": "CNY" 
    }, 
    "reason": "退款测试""notify_url": "https://3da873dd3c62.ngrok.io/api/orders/callback" 
    }
    HTTP/1.1 400 Bad Request
    Server: nginx
    Date: Thu, 12 Nov 2020 06:47:24 GMT
    Content-Type: application/json; charset=utf-8
    Content-Length: 123
    Connection: keep-alive
    Keep-Alive: timeout=8
    Request-ID: 1bdf776d-62ef-5b7d-b03d-a0182de5c1dd
    Wechatpay-Nonce: 3d8b5b82515e4bcbecbdd5a060f53d07
    Wechatpay-Signature: kxS7e9m3OdA1sLHXNpAT7BFXZ8sCAquF/pbBBJe0d3HMTpr9HiTgQlr6GjPz+xFg6IWWYyehqKsGXMzvWMOl0RZynxztJY41R9DNmqQJqxYEkMQSHv/XCBx23EhJyWjKoU3Hq0z7a3Yd3wr5+Q+mrlhdFeVsBNVjVCZMLdMV/9F/govJw3qwfI4mC5S/cB+QWk1NdK6qo74peZSXGqp9hwQxI0Q6ryhXZHzwfbC2np2077avd8ykN/kqUjsbgeSiSyX3tK7se3NUPSekWCqXxniPxYSIPrU3EG179XTokpQyNNG+zEf1ptKItrkgzFzBF44azU/+FcMR3kEhkBnNSQ==
    Wechatpay-Timestamp: 1605163644
    Wechatpay-Serial: 38CECCD13A15C42F75FBA65CA1E7C8F20CFF104D
    Cache-Control: no-cache, must-revalidate
    Content-Language: zh-CN
    {"code":"PARAM_ERROR","message":"参数格式错误","detail":{"field":"#","issue":"缺少必填字段","location":"body"}}
    
    2020-11-12
    有用
    回复
  • 微信支付技术助手8
    微信支付技术助手8
    2020-11-12

    你好,麻烦提供下完整的请求参数。

    【文档问题您来提,精美好礼我来送~微信支付文档期待您的声音~】欢迎点击下方链接了解微信支付文档有奖反馈活动详情:https://developers.weixin.qq.com/community/pay/doc/000aa24226cb18f5cc1ba2b815b001

    文档反馈入口:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/api.shtml

    2020-11-12
    有用
    回复 1
    • 阿白
      阿白
      2020-11-12
      l来了 快来看看
      2020-11-12
      回复
登录 后发表内容
问题标签