申请扣款接口
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| auth_code | string | 支付凭证 |
| sp_appid | string | 服务商公众号appid |
| sp_mchid | string | 服务商商户号 |
| sub_appid | string | 子商户公众号appid |
| sub_mchid | string | 子商户商户号 |
| amount | object | 金额信息 |
| total | integer | 总金额 |
| currency | string | 货币类型CNY 枚举值 |
| scene_info | object | 支付场景信息 |
| device_ip | string | 设备IP |
| goods_tag | string | 优惠标记 |
| description | string | 商品信息 |
| attach | string | 商户附加信息 |
| settle_info | object | 结算信息 |
| profit_sharing | boolean | 是否支持分账 |
| out_trade_no | string | 商户订单号 |
| business | object | 业务信息 |
| business_product_id | integer | 平台产品ID2 | 11 枚举值之一 |
| business_scene_id | integer | 平台场景ID3 | 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_appid | string | 服务商公众号appid |
| sp_mchid | string | 服务商商户号 |
| sub_appid | string | 子商户公众号appid |
| sub_mchid | string | 子商户商户号 |
| payer | object | 支付用户信息 |
| sp_openid | string | 公众下的openid |
| sub_openid | string | 子公众下的openid |
| amount | object | 金额信息 |
| total | integer | 总金额 |
| currency | string | 货币类型CNY 枚举值 |
| promotion_detail | object[] | 优惠信息 |
| scene_info | object | 支付场景信息 |
| device_ip | string | 设备IP |
| bank_type | string | 付款银行 |
| trade_type | string | 交易类型NATIVE | JSAPI | APP | MWEB | AUTH 枚举值之一 |
| trade_state | string | 交易状态 |
| trade_state_description | string | 交易描述 |
| debt_state | string | 欠款状态 |
| description | string | 商品信息 |
| attach | string | 商户附加信息 |
| success_time | string | 支付成功时间 |
| transaction_id | string | 微信订单号 |
| repayment_transaction_id | string | 还款微信订单号 |
| out_trade_no | string | 商户订单号 |
| error_type | string | 错误分类 |
参阅 官方文档