用户入场通知
在停车场场景下,商户调用本接口,会注册接收用户场中状态变化通知,并返回用户车主服务是否可用的状态。调用该接口,微信侧不会向用户下发入场通知消息,消息由商户下发。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
appid | string | 公众账号id |
mch_id | string | 商户号 |
sign_type | string | 签名类型 |
version | string | 版本号 |
trade_scene | string | 交易场景 |
scene_info | string | 场景信息 |
start_time | string | 入场时间 |
notify_url | string | 回调通知URL |
plate_number | string | 车牌号 |
car_type | string | 车辆类型 |
parking_name | string | 停车场名称 |
free_time | string | 免费时长 |
openid | string | 用户标识 |
space_number | string | 车位编号 |
php
$instance->v2->vehicle->pay->notification->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/vehicle/pay/notification')->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/vehicle/pay/notification']->postAsync([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->vehicle->pay->notification->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/vehicle/pay/notification')->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/vehicle/pay/notification']->post([
'xml' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '10000098',
'sign_type' => 'HMAC-SHA256',
'version' => '3.0',
'trade_scene' => 'PARKING',
'scene_info' => '{"scene_info":{"start_time":"20170926114339","plate_number":"CB1000sdfasd","free_time":"1200","car_type":"大型车","parking_name":"欢乐海岸停车场"}}',
'start_time' => '20170826104339',
'notify_url' => 'https://weixin.qq.com',
'plate_number' => '粤B888888',
'car_type' => '小型车',
'parking_name' => '欢乐海岸停车场',
'free_time' => '1200',
'openid' => 'wxd930ea5d5a258f4f',
'space_number' => 'D6666',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码 |
return_msg | string | 返回信息 |
appid | string | 公众账号id |
mch_id | string | 商户号 |
nonce_str | string | 随机字符串 |
sign | string | 签名 |
result_code | string | 业务结果 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |
user_state | string | 用户状态 |
deduct_mode | string | 发起扣费方式 |
参阅 官方文档