下载资金账单
商户可以通过该接口下载自2017年6月1日起 的历史资金流水账单。
请求参数 | 类型 | 描述 |
---|---|---|
security | true | 声明加载商户API证书 |
xml | object | 声明请求的XML 数据结构 |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
sign_type | string | 签名类型 固定枚举值 HMAC-SHA256 |
bill_date | string | 资金账单日期 |
account_type | string | 资金账户类型Basic | Operation | Fees 枚举值之一 |
tar_type | string | 压缩账单GZIP 枚举值 |
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance->v2->pay->downloadfundflow->postAsync([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
})
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance->chain('v2/pay/downloadfundflow')->postAsync([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
})
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance['v2/pay/downloadfundflow']->postAsync([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
})
->wait();
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance->v2->pay->downloadfundflow->post([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
]);
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance->chain('v2/pay/downloadfundflow')->post([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
]);
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$response = $instance['v2/pay/downloadfundflow']->post([
'sink' => $stream,
'security' => true,
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
]);
$tmp = $response->getBody();
$tmp->tell() && $tmp->rewind();
$firstFiveBytes = $tmp->read(5);
if ('<xml>' === $firstFiveBytes) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
}
异常字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
result_code | string | 业务结果FAIL 枚举值 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |