收藏
回答

微信支付v3/global/transactions/jsapi报错$key0$参数格式错误?

[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 // 关键配置

                        ]

                        

                    ],

                    

                );

回答关注问题邀请回答
收藏

2 个回答

  • Memory
    Memory
    星期五 12:56

    V3 接口怎么有 V2 参数乱入?建议多认真比对一下文档

    星期五 12:56
    有用
    回复 2
  • 智能回答 智能回答 本次回答由AI生成
    星期五 12:28
    有用
    回复 1
    • 叶舞จุ๊บღ
      叶舞จุ๊บღ
      发表于移动端
      星期五 15:33
      [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 // 关键配置 ] ], );
      星期五 15:33
      回复
登录 后发表内容