收藏
回答

电商收付通 商户进件 400 bad request

  1. 非证书问题 上传图片和下载证接口都可以使用
  2. api代码
/**
 * 电商收付通相关API
 * Class ReceiptAndPayApi
 * @package common\components\pay\wxApi\v3
 */
class ReceiptAndPayApi extends AbstractApi {

    /**
     * 商户进件申请api地址
     */
    const MERCHANT_APPLY = self::PREFIX_URL.'ecommerce/applyments/';

    /**
     * 商户进件申请
     * @param $data array
     * @return array
     */
    public function applyMerchant($data){

        $resp = $this->client->post(self::MERCHANT_APPLY, [
            'json' => $data,
            'headers' => ArrayHelper::merge(static::getBaseRequestHeaders(), [
                'Wechatpay-Serial' => $this->merchantSerialNumber
            ])
        ]);
        return $this->returnResponse($resp);
    }
}

请求data数据

Array
(
    [out_request_no] => 20200907155423159946526332992859
    [organization_type] => 2401
    [id_doc_type] => IDENTIFICATION_TYPE_MAINLAND_IDCARD
    [id_card_info] => Array
        (
            [id_card_copy] => VfzhnJzs1_R3ctL4G8zusLm-LR9nQOyvzghDEYVmdrvHaEFH99zkzbpssRpBsVC1oB6IuzxvDdg8qpBpSb2urtsbT06s1dKJs8_3On4fhGE
            [id_card_national] => VfzhnJzs1_R3ctL4G8zusAn7pe9VhOqck9bdmN4nMOrwzmTYro7WuFxVrWKOh0oukgZg8Krch6qPKNwWmE476z6Sumuzlv6H4Psq9S15cBA
            [id_card_name] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => CdlJGcLkgDGsGy05miJLr1I66Rq+GwSqS86B7uFSJk2GDZ+oVgVKriSy7InC6j0BxqiQm3jfuJSucZww6nMfP3ytvn1AC7b6ntG37tenT/PoHMfUrUY7FlEYnGpc5R4G71s0gz4iugcD2rVNWoCJUsYkZqDMRoMqUTMJZbNaqVMbn0dNh4XuO+0taS2RaFtHVHex+oVlP5f2zr3HVSEUZgyC9ijV/zSepgBzunZkEJoz2081dgdZqHH0BFbiX0I5H41DbaXzXa7sVKhaHoJl85bEEMcvLxuE4SU4yBfP/sFlQTGZJLUMLaZtc9DgoNhCj8fG+ljtX5IwkAtdRY1mmw==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [id_card_number] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => gfJ4c7SzJg/BojVuShEJxf9ZVlhZ3Vc9shmAfVxSj300UkGEIZ+UwAvYef604294qR0qsqTNZyaZUwvOGFU/KTO+1uS8CN4Gh/wsy9jF8bP8j8t0G+Nguz46sCii4qaL3uiWN6Ae3uOZZRPjIBwOCoQLmtZvL/1HH9aYISNQKW4/2hzcrHxHawsfvvD5drGFJgQFmV5xz9tTCQQ5QNmtldzp276V7Wy8ZbVzXsNODyN8hzxPRB0dxkATQaQTjytwJHiYKlWm/h/x4TCw2zUpW74e15Mg9HdAvo92tlYs8JaZoglOUQAoECis4+k4SSMwWMjynV7lKnwQ2UXKrG5JjA==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [id_card_valid_time] => 长期
        )

    [need_account_info] => 1
    [account_info] => Array
        (
            [bank_account_type] => 75
            [account_bank] => 工商银行
            [account_name] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => dXHbsnnUY99Q4FkD7yLbd/e0vd88niSd4unH/EpueIVlrHqD/trPA8gpTY7p+YyMCY3g6Cw65IqxM6Atkt90DVK/F3ycAasH10hWl9ofzf5D/RKvKpZzguNNdRADxMd+4M1tV8h5wRK1s9dhcVjSG8Bi2M665MyTbjzce9T3/TFux5EbWfzvuKWdogtNkLVt0Ai2Ch3to4jSC6gwfr8C5NU1f/YTwDBNTKUvn2cUrVoy0Nba7Mcs4sanSrzUYqSAFrf3TwyZWQYbA2yypQ7ugrvbW7xs2ZmkucE7A/E+IIxv40jgXKJl+8lZPjjbZQmbpNUtWdWVCjpShIMI9udrOg==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [bank_address_code] => 371400
            [account_number] => 12
        )

    [contact_info] => Array
        (
            [contact_type] => 65
            [contact_name] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => YiuKN/plfWKDGc7KIkwDiBxguxChyRzo4Q4PdL0v6bY26fHK5n2amoMsPkgEnMINS9dFoMxVPLoBSaDZFxWt3lMgttK8cQe30QF82yEaNaAu5vriW1i0bD5hHNhKM7Vtm4ieqvn5HQ4mQpG7s+BIZ94NBPHFdvm1pHsUIWdFhNjhCu60xuuH41UaJRuYyKqd/UAUcvkBa0rCLSWigY8KZaSddy7JnsXQzSJu155Gs0UcoxmnnBqHBD0xMv3XHcm/HnR7kQ1rcDdoi7my9kFCW0hamhRTF/HJFGnpOAbZTj4CtCiZPIHxGA8xYIe1eAZ4VP4QwmZXNVYPS1cNLiEwVQ==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [contact_id_card_number] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => OuOqZ7hKF02yz+vY+W8QXu1FXKYozTMzHJCo66avP7EM6JFY19K2oSp96eqQSExhb37tU/BjlsWPE/wIaA8orvb4XIILTd6Nh7uz+O0taKrjV5U3G8WwXdJMyCxiMLY13pBBw7ge7QOptkVTFk7WkqPD35KweZjXm15ScQBf1Y0VzhmZJVPO29916tzuZbXtRGNLIe69nGZ5nyrhKOESqcRw6CXxeGqzgeDcMUQzVgcQqOVWdrj+0AVT9G1dZqC6pF7ihItWOs57yCd+NcqQr3xdfAEStZ81QbUjHVmI+ZhQne3dYpc8Qzx/EhWLf/dcAsuKBG+scP41QlbwbJc6BQ==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [mobile_phone] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => uZBBg5o5TNoY5gQu2DDXialSxIsu91nV8c8UjK61tRH7iMYqWVOrkvVt3p6Uuo3TAm3+KSNiTh3U+1JKxdPltGLgjnIcoICw3dJgcUExGLWhGTdu/1lKQV5lD386vxC9ewsiqYlvs8qiRAdOlJQQ0qi0N+7gtyrG3RObocHlf0o+fYiQQlH07L9KUHe6GSUAA/H/rJPZjdSji09dD+eFAFjVZKy/IwZVQ5lOpkH8HdROdTS8CDpG0Cu4NRQ1e4hSO9Oaco4Fir8prdjnyfNmJh4V2LF11DUmXXShcCSsBuacTUUwWM6mjnYd78ZAj2HIdBVLKQyDKos6yYiIeG//Jw==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

            [contact_email] => WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto Object
                (
                    [publicCert:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => Resource id #218
                    [privateKey:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => 
                    [message:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => gFCQ0oa0GzNOKvqAmBtCViEfu3X1Jr4seERCe03qJ3H9QDkfhlbiuIWC6ZVAmOYSVBch7Izz+DV3mOs6dmmJd8tpPhonJqu8MRxUY/WnoDKfXwLbm5WW3yHn8HbuYr0pytN1UCUJ0MR83eAsd8HbXIzWf4eSau/LACvPvtEp1CQdPaZbrEKMU9gSb/WxVOmFDCpQZPi08YpSuP9nv4KggUUFUij2gN5CvEX3kfgp/jp6j/fH8FWNdIZ5rZgYrseKL/PXbRvjFQeIIb5+8uLsr9CBT+Z+eLTwcC0fP4FbGNw3+VMwDji8/cqWCRLoUBWMHSn7zHzzSovV9rCxfFbVlA==
                    [stage:WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto:private] => encrypt
                )

        )

    [sales_scene_info] => Array
        (
            [store_name] => 12
            [store_qr_code] => mggX3-2QEjM08UNAKPK1In3gq3aUWtaayt1dniakh_TOj1gSZnfWY1-wS_QO-wxbeNDP_oSYnDsKD4Uhhwg1apGKIsh7OlOGbTBgGOULN9g
        )

    [merchant_shortname] => 12121
)

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

3 个回答

  • 微信支付技术助手8
    微信支付技术助手8
    2020-09-10

    你好,400 bad request。一般是你的请求参数,请求语法的问题。麻烦参考https://wechatpay-api.gitbook.io/wechatpay-api-v3/wei-xin-zhi-fu-api-v3-jie-kou-gui-fan。进行参数核实。

    2020-09-10
    有用
    回复
  • 老张
    老张
    2020-09-09

    400是参数错误。其他证书签名的说明都没问题了。

    至于进件参数问题,就谁也帮不了了,谁知道你哪一个参数少个符号?

    2020-09-09
    有用
    回复
  • 北望沣渭
    北望沣渭
    2020-09-09
    'Wechatpay-Serial' => $this->merchantSerialNumber
    


    这个是不是给错了,看字面意思,是商户序列号,这个是要给平台证书序列号。

    PS:WechatPay\GuzzleMiddleware\Util\MediaUtil & WechatPay\GuzzleMiddleware\Util\SensitiveInfoCrypto 这俩类,用着还香伐?😄

    2020-09-09
    有用
    回复 2
    • 三师兄🦊
      三师兄🦊
      2020-09-09
      序列号换成平台证书序列号(使用API更新下来的序列号)也不行,还是报 400,
      这两个类用的少,没感觉。
      2020-09-09
      回复
    • 。。。。
      。。。。
      2020-09-11
      解决了吗,同样的问题
      2020-09-11
      回复
登录 后发表内容
问题标签