下载资金账单
商户可以通过该接口下载自2017年6月1日起 的历史资金流水账单。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
appid | string | 公众账号ID |
mch_id | string | 商户号 |
sign_type | string | 签名类型 |
bill_date | string | 资金账单日期 |
account_type | string | 资金账户类型 |
tar_type | string | 压缩账单 |
security | boolean | 声明加载商户API证书 固定值 true |
php
$savedTo = \GuzzleHttp\Psr7\Utils::tryFopen('./somehowfile.csv.gz', 'w+');
$stream = \GuzzleHttp\Psr7\Utils::streamFor($savedTo);
$instance->v2->pay->downloadfundflow->postAsync([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
])
->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([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
])
->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([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
])
->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([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
]);
$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([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
]);
$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([
'xml' => [
'appid' => 'wx8888888888888888',
'mch_id' => '1900000109',
'sign_type' => 'HMAC-SHA256',
'bill_date' => '20140603',
'account_type' => 'Basic',
'tar_type' => 'GZIP',
],
'security' => true,
]);
$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 | 返回状态码 |
return_msg | string | 返回信息 |
result_code | string | 业务结果 |
err_code | string | 错误代码 |
err_code_des | string | 错误代码描述 |