申请二级商户充值
商户系统须通过调用此接口获取充值链接,随后发起充值流程
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
sub_mchid | string | 二级商户号 |
out_recharge_no | string | 商户充值单号 |
recharge_scene | string | 充值场景ECOMMERCE_DEPOSIT | ECOMMERCE_BANK_TRANSFER | NORMAL_BANK_TRANSFER 枚举值之一 |
account_type | string | 充值入账账户DEPOSIT | BASIC | OPERATION | FEES 枚举值之一 |
recharge_amount | object | 充值金额 |
amount | number | 总金额 |
currency | string | 货币类型 |
notify_url | string | 商户回调地址 |
php
$instance->v3->platsolution->ecommerce->recharges->apply->postAsync([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/platsolution/ecommerce/recharges/apply')->postAsync([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/platsolution/ecommerce/recharges/apply']->postAsync([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->platsolution->ecommerce->recharges->apply->post([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/platsolution/ecommerce/recharges/apply')->post([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/platsolution/ecommerce/recharges/apply']->post([
'json' => [
'sub_mchid' => '1900001109',
'out_recharge_no' => 'cz202407181234',
'recharge_scene' => 'ECOMMERCE_DEPOSIT',
'account_type' => 'DEPOSIT',
'recharge_amount' => [
'amount' => 500000,
'currency' => 'CNY',
],
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
recharge_id | string | 微信支付充值单号 |
out_recharge_no | string | 商户充值单号 |
recharge_url | string | 充值链接 |
参阅 官方文档