申请二级商户充值
商户系统须通过调用此接口获取充值链接,随后发起充值流程
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| sub_mchid | string | 二级商户号 |
| out_recharge_no | string | 商户充值单号 |
| recharge_scene | string | 充值场景ECOMMERCE_DEPOSIT | ECOMMERCE_PAYMENT 枚举值之一 |
| account_type | string | 充值入账账户DEPOSIT | OPERATION 枚举值之一 |
| recharge_amount | object | 充值金额 |
| amount | number | 总金额 |
| currency | string | 货币类型 |
| notify_url | string | 商户回调地址 |
| available_recharge_channels | string[] | 可用充值渠道列表BANK_TRANSFER | QR_RECHARGE | ONLINE_BANK 枚举值之一 |
| remark | 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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
])
->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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
])
->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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
])
->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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
]);
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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
]);
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',
'available_recharge_channels' => ['BANK_TRANSFER'],
'remark' => 'example_remark',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| recharge_id | string | 微信支付充值单号 |
| out_recharge_no | string | 商户充值单号 |
| recharge_url | string | 充值链接 |
参阅 官方文档