调用的 JSAPI下单接口
https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi
参数如下传递,为了隐私,数据部分隐藏了
{
"amount": {
"total": 1
},
"attach": "***",
"description": "测试",
"notify_url": "***",
"out_trade_no": "***",
"payer": {
"sub_openid": "***"
},
"profit_sharing": "Y",
"sp_appid": "***",
"sp_mchid": "***",
"sub_appid": "***",
"sub_mchid": "***"
}
原先是没有问题的。但是我需要对这个订单进行分账 增加了一个profit_sharding 参数 就报错了 返回内容如下
{
"code": "PARAM_ERROR",
"detail": {
"location": null,
"value": [
"/body/profit_sharing"
]
},
"message": "请求中含有未在API文档中定义的参数"
}
按照此页面页尾描述 增加的字段
https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter4_1_3.shtml
{ "sp_appid": "wx8888888888888888", "sp_mchid": "1230000109", "sub_appid": "wxd678efh567hg6999", "sub_mchid": "1900000109", "settle_info": { "profit_sharing": true, "subsidy_amount": 10 }, "description": "Image形象店-深圳腾大-QQ公仔", "attach": "自定义数据", "out_trade_no": "1217752501201407033233368018", "amount": { "total": 100, "currency": "CNY" }, "time_expire": "2018-06-08T10:34:56+08:00", "notify_url": "https://www.weixin.qq.com/wxpay/pay.php", "goods_tag": "WXG", "detail": { "cost_price": 608800, "invoice_id": "微信123", "goods_detail": [ { "merchant_goods_id": "商品编码", "wechatpay_goods_id": "1001", "goods_name": "iPhoneX 256G", "quantity": 1, "unit_price": 828800 } ] }, "scene_info": { "payer_client_ip": "14.23.150.211", "device_id": "013467007045764", "store_info": { "id": "0001", "name": "腾讯大厦分店", "area_code": "440305", "address": "广东省深圳市南山区科技中一道10000号" } }, "payer": { "sp_openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o", "sub_openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o" } }
数据格式如上,请自行对照,再线自助版见:https://thenorthmemory.github.io/wechatpay-openapi/