高速场景商户扣款
ETC高速场景订单扣款下单
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
out_trade_no | string | 商户订单号 |
sub_mchid | string | 特约商户号 |
appid | string | 商户appid |
sub_appid | string | 特约商户appid |
contract_id | string | ETC扣费授权协议号 |
description | string | 商品信息 |
attach | string | 附加信息 |
goods_tag | string | 营销信息 |
highway_info | object | 高速场景信息 |
plate_number | string | 车牌号 |
start_time | string | 入站时间 |
end_time | string | 出站时间 |
channel_type | string | 通道类型 |
car_type | string | 车辆类型 |
entrance | string | 入口名称 |
exit | string | 出口名称 |
carrying_capacity | integer | 承载人数 |
carrying_range | string | 荷载范围 |
amount | object | 订单金额 |
total | integer | 订单金额 |
currency | string | 货币类型 |
device_info | object | 设备信息 |
device_id | string | 商户端设备号 |
device_ip | string | 商户端设备IP |
php
$instance->v3->vehicle->etc->transactions->highway->postAsync([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/vehicle/etc/transactions/highway')->postAsync([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/vehicle/etc/transactions/highway']->postAsync([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->vehicle->etc->transactions->highway->post([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/vehicle/etc/transactions/highway')->post([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/vehicle/etc/transactions/highway']->post([
'json' => [
'out_trade_no' => '121775250124070332',
'sub_mchid' => '1900000109',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6999',
'contract_id' => 'wxd678ef4Fwxd678ef4Fwxd678ef4F21',
'description' => '商品信息',
'attach' => '自定义数据',
'goods_tag' => 'test',
'highway_info' => [
'plate_number' => '粤B888888',
'start_time' => '2017-08-26T09:43:39+08:00',
'end_time' => '2017-08-26T09:43:39+08:00',
'channel_type' => 'ETC',
'car_type' => 'CAR',
'entrance' => '沿江深圳-大铲湾',
'exit' => '广珠东线-珠海站',
'carrying_capacity' => 3,
'carrying_range' => '6-12',
],
'amount' => [
'total' => 888,
'currency' => 'CNY',
],
'device_info' => [
'device_id' => 'POS1:1',
'device_ip' => '123.12.12.123',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
mchid | string | 商户号 |
sub_mchid | string | 特约商户号 |
appid | string | 商户appid |
sub_appid | string | 特约商户appid |
out_trade_no | string | 商户订单号 |
transaction_id | string | 微信支付订单号 |
attach | string | 商户数据 |
trade_type | string | 交易类型 |
bank_type | string | 付款银行 |
success_time | string | 支付完成时间 |
trade_state | string | 交易状态 |
trade_state_desc | string | 交易状态描述 |
payer | object | 支付者 |
sp_openid | string | 用户在服务商APP的标识 |
sub_openid | string | 用户在特约商户APP的标识 |
amount | object | 订单金额 |
total | integer | 订单金额 |
currency | string | 货币类型 |
payer_total | integer | 用户实际支付金额 |
discount_total | integer | 折扣 |
device_info | object | 设备信息 |
device_id | string | 商户端设备号 |
device_ip | string | 商户端设备IP |
promotion_detail | object[] | 优惠详情 |
promotion_id | string | 券ID |
name | string | 优惠名称 |
scope | string | 优惠范围 |
type | string | 优惠类型 |
activity_id | string | 活动ID |
amount | integer | 优惠券面额 |
wxpay_contribute | integer | 微信出资 |
merchant_contribute | integer | 商户出资 |
other_contribute | integer | 其他出资 |
参阅 官方文档