Skip to content

申请扣款接口

请求参数类型描述
jsonobject声明请求的JSON数据结构
auth_codestring支付凭证
sp_appidstring服务商公众号appid
sp_mchidstring服务商商户号
sub_appidstring子商户公众号appid
sub_mchidstring子商户商户号
amountobject金额信息
totalinteger总金额
currencystring货币类型
CNY 枚举值
scene_infoobject支付场景信息
device_ipstring设备IP
goods_tagstring优惠标记
descriptionstring商品信息
attachstring商户附加信息
settle_infoobject结算信息
profit_sharingboolean是否支持分账
out_trade_nostring商户订单号
businessobject业务信息
business_product_idinteger平台产品ID
2 | 11 枚举值之一
business_scene_idinteger平台场景ID
3 | 4 | 5 | 6 | 124 | 125 | 126 枚举值之一
php
$instance->v3->offlineface->transactions->postAsync([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/offlineface/transactions')->postAsync([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/offlineface/transactions']->postAsync([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->offlineface->transactions->post([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/offlineface/transactions')->post([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/offlineface/transactions']->post([
  'json' => [
    'auth_code'    => '',
    'sp_appid'     => '',
    'sp_mchid'     => '',
    'sub_appid'    => '',
    'sub_mchid'    => '',
    'amount'       => [
      'total'    => 0,
      'currency' => 'CNY',
    ],
    'scene_info'   => [
      'device_ip' => '',
    ],
    'goods_tag'    => '',
    'description'  => '',
    'attach'       => '',
    'settle_info'  => [
      'profit_sharing' => true,
    ],
    'out_trade_no' => '',
    'business'     => [
      'business_product_id' => 0,
      'business_scene_id'   => 0,
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sp_appidstring服务商公众号appid
sp_mchidstring服务商商户号
sub_appidstring子商户公众号appid
sub_mchidstring子商户商户号
payerobject支付用户信息
sp_openidstring公众下的openid
sub_openidstring子公众下的openid
amountobject金额信息
totalinteger总金额
currencystring货币类型
CNY 枚举值
promotion_detailobject[]优惠信息
scene_infoobject支付场景信息
device_ipstring设备IP
bank_typestring付款银行
trade_typestring交易类型
NATIVE | JSAPI | APP | MWEB | AUTH 枚举值之一
trade_statestring交易状态
trade_state_descriptionstring交易描述
debt_statestring欠款状态
descriptionstring商品信息
attachstring商户附加信息
success_timestring支付成功时间
transaction_idstring微信订单号
repayment_transaction_idstring还款微信订单号
out_trade_nostring商户订单号
error_typestring错误分类

参阅 官方文档

Published on the GitHub by TheNorthMemory