Skip to content

预开通用户ETC指定卡扣费

该接口用于在开通ETC自动扣费前上传一些必要的信息。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sp_appidstring服务商appid
sub_appidstring子商户appid
sub_mchidstring特约商户号
openidstring用户标识
plan_idstringETC授权扣费模板ID
etc_device_idstringETC设备号
plate_numberstring车牌号
identifyobject实名信息
encrypted_real_namestring姓名
encrypted_credential_idstring证件号码
credential_typestring证件类型
bank_card_nostring用户开通ETC时绑定的银行卡
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->vehicle->etc->preopen->postAsync([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/vehicle/etc/preopen')->postAsync([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/vehicle/etc/preopen']->postAsync([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->vehicle->etc->preopen->post([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/vehicle/etc/preopen')->post([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/vehicle/etc/preopen']->post([
  'json' => [
    'sp_appid' => '10000098',
    'sub_appid' => 'wxcbda96de0b165489',
    'sub_mchid' => '1510770601',
    'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
    'plan_id' => '97619',
    'etc_device_id' => 'xxxxxxx',
    'plate_number' => '藏ZZZZZZ',
    'identify' => [
      'encrypted_real_name' => 'LOX6jBeRlK/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
      'encrypted_credential_id' => 't85SAX3GxVYqGQm2Q8cfeFd1dWy40j4s7XpIds8Glw83HG3vN9Q==',
      'credential_type' => 'ID_CARD',
    ],
    'bank_card_no' => 'K/TErW6DqEM8JFHX4iL3Rlj2vqaEqktvw1KVjgmQ==',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
preopen_idstring预开通ID

参阅 官方文档

Published on the GitHub by TheNorthMemory