Skip to content

查询订单剩余可出境余额

电商收付通中,针对多次请求出境的场景,商家需要查询可出境金额之后再进行出境请求其中:订单剩余可出境金额=订单可出境金额-已累计出境金额

请求参数类型描述
transaction_idstring微信支付订单号
queryobject声明请求的查询参数
sub_mchidstring二级商户号
php
$instance->v3->fundsToOversea->transactions->_transaction_id_->available_abroad_amounts->getAsync([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/funds-to-oversea/transactions/{transaction_id}/available_abroad_amounts')->getAsync([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/funds-to-oversea/transactions/{transaction_id}/available_abroad_amounts']->getAsync([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->fundsToOversea->transactions->_transaction_id_->available_abroad_amounts->get([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/funds-to-oversea/transactions/{transaction_id}/available_abroad_amounts')->get([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/funds-to-oversea/transactions/{transaction_id}/available_abroad_amounts']->get([
  'transaction_id' => '4208450740201411110007820472',
  'query' => [
    'sub_mchid' => '1900000109',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
transaction_idstring微信支付订单号
available_abroad_amountinteger订单剩余可出境金额

参阅 官方文档

Published on the GitHub by TheNorthMemory