此贴已终结,问题已解决,只能说一路过来,一路坑。我后端用的是thinkphp,选择官方的【wechatpay-guzzle-middleware】进行接口开发,所以商户进件,图片上传,证书下载,支付下单、支付回调等接口都是基于官方的wechatpay-guzzle-middleware SDK开发。如果大家遇到什么不懂,可以加我微信qyt80800
合单下单-JS支付API为什么一直报400 Bad Request错误在请求官方【https://api.mch.weixin.qq.com/v3/combine-transactions/jsapi】合单下单-JS支付API,一直报400 Bad Request错误 我的header为:【metaJson为官方php提供SDK,传过去为了签名,所以这个应该没错,我用官方phpSDK进件和进件查询请求接口都正常了,到这个合单就包400错误,按跟进件的POST请求一样啊】 "Accept": "application/json", "Content-Type": "application/json", "Wechatpay-Serial": "5CFB23F5EFE777A2651C4FE409D9FD6A007FC0C3", "metaJson": "{\"combine_appid\":\"wx09f6dc683d4ab4d8\",\"combine_mchid\":\"1557374351\",\"combine_out_trade_no\":\"flq_1584957318\", \"scene_info\":{\"device_id\":\"XCX:1\",\"payer_client_ip\":\"121.207.122.155\"},\"sub_orders\":[{\"mchid\":\"1557374351\",\"attach\": \"599\",\"amount\":{\"total_amount\":10,\"currency\":\"CNY\"},\"out_trade_no\":\"fl12q_1584957318\",\"sub_mchid\":\"1581147271\", \"detail\":\"\",\"profit_sharing\":true,\"description\":\"\\u6811\\u8102\\u7ebd\\u626324L\"}],\"combine_payer_info\": {\"openid\":\"oRL0J41MdqQ1TfwoFf0goL2k1IPg\"},\"time_start\":\"2020-03-23T17:59:60+08:00\",\"time_expire\": \"2020-03-24T17:59:60+08:00\",\"notify_url\":\"https:\\/\\/api.fuliaoquan.com\\/\",\"limit_pay\":[\"no_debit\"]}" json为 { "combine_appid": "wx09f6dXXXXd4ab4d8", "combine_mchid": "15573***51", "combine_out_trade_no": "f_1584956927", "scene_info": { "device_id": "XCX:1", "payer_client_ip": "125.206.122.155" }, "sub_orders": [ { "mchid": "15573**351", "attach": "599", "amount": { "total_amount": 10, "currency": "CNY" }, "out_trade_no": "f2_1584956927", "sub_mchid": "1581**7271", "detail": "", "profit_sharing": true, "description": "树脂纽扣24L" } ], "combine_payer_info": { "openid": "oRL0J41MdqQ1TfwoFf0goL2k1IPg" }, "time_start": "2020-03-23T17:59:60+08:00", "time_expire": "2020-03-24T17:59:60+08:00", "notify_url": "https://api.XXX.com/", "limit_pay": [ "no_debit" ] } 按官方的JSON实例,没有必填的参数也填上去了,回调地址写的是一个官网,还没错回调,按理说现在回调地址不会请求校验把。 实在想不出哪里出问题了!还是参数错了。因为商户进件接口都是这样请求,都正常返回的!
2020-03-24