Skip to content

创建停车入场

车辆入场以后,商户调用该接口,创建停车入场信息。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sub_mchidstring子商户号
out_parking_nostring商户入场id
plate_numberstring车牌号
plate_colorstring车牌颜色
BLUE | GREEN | YELLOW | BLACK | WHITE | LIMEGREEN 枚举值之一
notify_urlstring回调通知url
start_timestring入场时间
parking_namestring停车场名称
free_durationinteger免费时长
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->vehicle->parking->parkings->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  '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/parking/parkings')->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  '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/parking/parkings']->postAsync([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  '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->parking->parkings->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/vehicle/parking/parkings')->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/vehicle/parking/parkings']->post([
  'json' => [
    'sub_mchid'      => '1900000109',
    'out_parking_no' => '1231243',
    'plate_number'   => '粤B888888',
    'plate_color'    => 'BLUE',
    'notify_url'     => 'https://yoursite.com/wxpay.html',
    'start_time'     => '2017-08-26T10:43:39+08:00',
    'parking_name'   => '欢乐海岸停车场',
    'free_duration'  => 3600,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
idstring停车入场id
out_parking_nostring商户入场id
plate_numberstring车牌号
plate_colorstring车牌颜色
BLUE | GREEN | YELLOW | BLACK | WHITE | LIMEGREEN 枚举值之一
start_timestring入场时间
parking_namestring停车场名称
free_durationinteger免费时长
statestring停车入场状态
block_reasonstring不可用状态描述

参阅 官方文档

Published on the GitHub by TheNorthMemory