获取微信支付二维码链接时,调用接口提示 400
提示错误:
[400] ClientException in RequestException.php line 113
Client error: `POST https://api.mch.weixin.qq.com/v3/pay/transactions/native` resulted in a `400 Bad Request` response
一下是请求参数:
$resp = $client->request(
'POST',
'https://api.mch.weixin.qq.com/v3/pay/transactions/native', //请求URL
[
// JSON请求体
'json' => [
"time_expire" => "2018-06-08T10:34:56+08:00",
"amount" => [
"total" => 100,
"currency" => "CNY",
],
"mchid" => "1230000109",
"description" => "Image形象店-深圳腾大-QQ公仔",
"notify_url" => "https://www.weixin.qq.com/wxpay/pay.php",
"out_trade_no" => "1217752501201407033233368018",
"goods_tag" => "WXG",
"appid" => "wxd678efh567hg6787",
"attach" => "自定义数据说明",
"detail" => [
"invoice_id" => "wx123",
"goods_detail" => [
[
"goods_name" => "iPhoneX 256G",
"wechatpay_goods_id" => "1001",
"quantity" => 1,
"merchant_goods_id" => "商品编码",
"unit_price" => 828800,
],
[
"goods_name" => "iPhoneX 256G",
"wechatpay_goods_id" => "1001",
"quantity" => 1,
"merchant_goods_id" => "商品编码",
"unit_price" => 828800,
],
],
"cost_price" => 608800,
],
"scene_info" => [
"store_info" => [
"address" => "广东省深圳市南山区科技中一道10000号",
"area_code" => "440305",
"name" => "腾讯大厦分店",
"id" => "0001",
],
"device_id" => "013467007045764",
"payer_client_ip" => "14.23.150.211",
]
],
'headers' => [ 'Accept' => 'application/json' ]
]