创建停车入场
车辆入场以后,商户调用该接口,创建停车入场信息。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
sub_mchid | string | 子商户号 |
out_parking_no | string | 商户入场id |
plate_number | string | 车牌号 |
plate_color | string | 车牌颜色BLUE | GREEN | YELLOW | BLACK | WHITE | LIMEGREEN 枚举值之一 |
notify_url | string | 回调通知url |
start_time | string | 入场时间 |
parking_name | string | 停车场名称 |
free_duration | integer | 免费时长 |
headers | object | 声明请求的头参数 |
Wechatpay-Serial | string | 平台公钥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));
返回字典 | 类型 | 描述 |
---|---|---|
id | string | 停车入场id |
out_parking_no | string | 商户入场id |
plate_number | string | 车牌号 |
start_time | string | 入场时间 |
parking_name | string | 停车场名称 |
free_duration | integer | 免费时长 |
state | string | 停车入场状态 |
block_reason | string | 不可用状态描述 |
参阅 官方文档