Skip to content

扣费受理

商户请求扣费受理接口,会完成订单受理。微信支付进行异步扣款,支付完成后,会将订单支付结果发送给商户。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring应用ID
sub_appidstring子商户应用ID
sub_mchidstring子商户号
descriptionstring服务描述
attachstring附加数据
out_trade_nostring商户订单号
trade_scenestring交易场景
goods_tagstring订单优惠标记
notify_urlstring回调通知url
profit_sharingstring分账标识
amountobject订单金额
totalinteger订单金额
currencystring货币类型
parking_infoobject停车场景信息
parking_idstring停车入场id
plate_numberstring车牌号
plate_colorstring车牌颜色
BLUE | GREEN | YELLOW | BLACK | WHITE | LIMEGREEN 枚举值之一
start_timestring入场时间
end_timestring出场时间
parking_namestring停车场名称
charging_durationinteger计费时长
device_idstring停车场设备id
php
$instance->v3->vehicle->transactions->parking->postAsync([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/vehicle/transactions/parking')->postAsync([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/vehicle/transactions/parking']->postAsync([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->vehicle->transactions->parking->post([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/vehicle/transactions/parking')->post([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/vehicle/transactions/parking']->post([
  'json' => [
    'appid' => 'wxcbda96de0b165486',
    'sub_appid' => 'wxcbda96de0b165486',
    'sub_mchid' => '1900000109',
    'description' => '停车场扣费',
    'attach' => '深圳分店',
    'out_trade_no' => '20150806125346',
    'trade_scene' => 'PARKING',
    'goods_tag' => 'WXG',
    'notify_url' => 'https://yoursite.com/wxpay.html',
    'profit_sharing' => 'Y',
    'amount' => [
      'total' => 888,
      'currency' => 'CNY',
    ],
    'parking_info' => [
      'parking_id' => '5K8264ILTKCH16CQ250',
      'plate_number' => '粤B888888',
      'plate_color' => 'BLUE',
      'start_time' => '2017-08-26T10:43:39+08:00',
      'end_time' => '2017-08-26T10:43:39+08:00',
      'parking_name' => '欢乐海岸停车场',
      'charging_duration' => 3600,
      'device_id' => '12313',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstring应用ID
sub_appidstring子商户应用ID
sp_mchidstring商户号
sub_mchidstring子商户号
descriptionstring服务描述
create_timestring订单创建时间
out_trade_nostring商户订单号
transaction_idstring微信支付订单号
trade_statestring交易状态
trade_state_descriptionstring交易状态描述
success_timestring支付完成时间
bank_typestring付款银行
user_repaidstring用户是否已还款
attachstring附加数据
trade_scenestring交易场景
parking_infoobject停车场景信息
parking_idstring停车入场id
plate_numberstring车牌号
start_timestring入场时间
end_timestring出场时间
parking_namestring停车场名称
charging_durationinteger计费时长
device_idstring停车场设备id
payerobject支付者信息
openidstring用户在appid下的标识
sub_openidstring用户在sub_appid下的标识
amountobject订单金额信息
totalinteger订单金额
currencystring货币类型
payer_totalinteger用户实际支付金额
discount_totalinteger折扣
promotion_detailobject[]优惠信息
coupon_idstring券ID
namestring优惠名称
scopestring优惠范围
typestring优惠类型
stock_idstring活动ID
amountinteger优惠券面额
wechatpay_contributeinteger微信出资
merchant_contributeinteger商户出资
other_contributeinteger其他出资
currencystring优惠币种

参阅 官方文档

Published on the GitHub by TheNorthMemory