[error] [400]Client error: `POST https://api.mch.weixin.qq.com/v3/global/transactions/jsapi` resulted in a `400 Bad Request` response:
{"code":"PARAM_ERROR","message":"$key0$参数格式错误"}
$resp = $instance
->chain('v3/global/transactions/jsapi')
->post(
['json' =>
[
'appid' => 'wx*******88',//微信公众号appid
'mchid' => $merchantId,
'description' => 'description',
'out_trade_no' => (string)time(),//内部订单号
'notify_url' => 'https://******/notify/',
'trade_type' => 'JSAPI',
'attach'=>(string)time(),
// 'detail'=>[],
'merchant_category_code'=>'4112',//行业编码
'amount' => [
'total' => 1,
'currency' => 'CNY'
],
'payer' => [
'openid' => $openid//用户微信授权openid
],
],
'headers' => [
'Wechatpay-Serial' => $platformCertificateSerialOrPublicKeyId // 关键配置
]
],
);
V3 接口怎么有 V2 参数乱入?建议多认真比对一下文档