受理扣款
商户调用「预约扣费」接口预约成功后,可调用本接口发起委托代扣扣款。系统受理扣款请求后,异步进行扣款,并通过商户指定的回调地址通知扣费结果。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
appid | string | 应用ID |
out_trade_no | string | 商户订单号 |
description | string | 商品描述 |
transaction_notify_url | string | 通知地址 |
contract_id | string | 委托代扣协议ID |
amount | object | 扣费金额信息 |
total | number | 金额 |
currency | string | 货币类型 |
goods_tag | string | 订单优惠标记 |
attach | string | 附加数据 |
php
$instance->v3->papay->pay->transactions->apply->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/papay/pay/transactions/apply')->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/papay/pay/transactions/apply']->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->papay->pay->transactions->apply->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/papay/pay/transactions/apply')->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/papay/pay/transactions/apply']->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'out_trade_no' => '1217752501201407033233368018',
'description' => 'Image形象店-深圳腾大-QQ公仔',
'transaction_notify_url' => 'https://www.qq.com/',
'contract_id' => '123124412412423431',
'amount' => [
'total' => 1,
'currency' => 'CNY',
],
'goods_tag' => 'DISCOUNTS',
'attach' => '自定义数据',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
out_trade_no | string | 商户订单号 |
amount | object | 扣费金额信息 |
total | number | 金额 |
currency | string | 货币类型 |
参阅 官方文档