收藏
回答

合单支付下单失败,返回错误信息无法定位问题原因

这是我的请求参数:

{
    "combine_appid": "wx3b56d***eb6ba47c",
    "combine_mchid": "14***24672",
    "combine_out_trade_no": "WXCOMBINE1596528777326",
    "combine_payer_info": {
        "openid": "o7hp206PcK9J***X76aPPCS5x4"
    },
    "notify_url": "http://*****.com.cn/pay/combinPay/notifyUrl",
    "scene_info": {
        "device_id": "1111111",
        "payer_client_ip": "49.73.***.207"
    },
    "sub_orders": [
        {
            "amount": {
                "currency": "CNY",
                "total_amount": 4
            },
            "attach": "附加信息",
            "description": "合单支付",
            "mchid": "14884**672",
            "out_trade_no": "WXCOMBINE1596528777326-1",
            "settle_info": {
                "profit_sharing": true,
                "subsidy_amount": 1
            },
            "sub_mchid": "1489***082"
        }
    ],
    "time_expire": "2020-08-04T16:42:57+08:00",
    "time_start": "2020-08-04T16:12:57+08:00"
}


这是官方的示例参数:

{
 "combine_out_trade_no": "1217752501201407033233368018",
 "combine_mchid": "1230000109",
 "combine_appid": "wxd678efh567hg6787",
 "scene_info": {
   "device_id": "POS1:1",
   "payer_client_ip": "14.17.22.32"
 },
 "sub_orders": [
   {
     "mchid": "1230000109",
     "attach": "深圳分店",
     "amount": {
       "total_amount": 10,
       "currency": "CNY"
     },
     "out_trade_no": "20150806125346",
     "sub_mchid": "1900000109",
     "description": "腾讯充值中心-QQ会员充值"
   }
 ],
 "combine_payer_info": {
   "openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
 },
 "time_start": "2018-06-08T10:34:56+08:00",
 "time_expire": "2018-06-08T10:34:56+08:00",
 "notify_url": "https://yourapp.com/notify",
 }
 


参数比对过了,没有问题,但是我请求就返回下面信息,就算出错了,那也要告诉我哪里错误。

返回错误信息:

HttpResponseProxy{HTTP/1.1 400 Bad Request [Server: nginx, Date: Tue, 04 Aug 2020 08:12:57 GMT, Content-Type: application/json; charset=utf-8, Content-Length: 71, Connection: keep-alive, Keep-Alive: timeout=8, Cache-Control: no-cache, must-revalidate, X-Content-Type-Options: nosniff, Request-ID: kinag6, Content-Language: zh-CN] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 71,Chunked: false]}}

最后一次编辑于  2020-08-04
回答关注问题邀请回答
收藏

2 个回答

  • 微信支付技术助手8
    微信支付技术助手8
    2020-08-04

    Http头缺少Accept或User-Agent,麻烦核实请求是否有问题。参考https://wechatpay-api.gitbook.io/wechatpay-api-v3/ren-zheng/qian-ming-he-zheng-sh

    2020-08-04
    有用
    回复 2
    • 李刚
      李刚
      2020-08-06
      添加了头信息报401: HttpResponseProxy{HTTP/1.1 401 Unauthorized [Server: nginx, Date: Thu, 06 Aug 2020 04:19:45 GMT, Content-Type: application/json; charset=utf-8, Content-Length: 385, Connection: keep-alive, Keep-Alive: timeout=8, Cache-Control: no-cache, must-revalidate, X-Content-Type-Options: nosniff, Request-ID: wq69t8, Content-Language: zh-CN] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 385,Chunked: false]}}
      2020-08-06
      回复
    • 微信支付技术助手8
      微信支付技术助手8
      2020-08-06回复李刚
      401是签名错误
      验证签名工具:
      链接:https://pan.baidu.com/s/1ixOAnYyZVW13dFr0jWVpvw
      提取码:wujv
      用工具进行排查签名
      2020-08-06
      回复
  • Anker.
    Anker.
    2020-08-04

    检查一下参数都正确吗

    2020-08-04
    有用
    回复 2
    • 李刚
      李刚
      2020-08-04
      检查了,和官方的示例参数比对了没问题。
      2020-08-04
      回复
    • DOU士·杨
      DOU士·杨
      2020-09-14
      估计是证书啥的没有弄对
      2020-09-14
      回复
登录 后发表内容
问题标签