下载结算文件
调用此接口之前,需先联系我们开通下载权限。
Content-Type: application/json; charset=UTF-8 ❌
Content-Type: application/json ✅
请求参数
GET
Header
注意
- 以下参数请添加到请求头,不要拼接在请求路径中
- 请注意日期格式为
yyyyMMdd
,如20211026
,不是2021-10-26
- 该接口返回的是文件流,响应头中
Content-Type
为application/octet-stream
- 字符集只支持
UTF-8
- 建议将文件流写入后缀为
csv
的文件中
名称 | 类型 | 长度 | 必填 | 签名 | 描述 |
---|---|---|---|---|---|
merchantNo | String | 20 | Yes | Yes | 商户号。 商户注册时,OnerWay 会为商户创建商户号 |
date | String | 8 | Yes | Yes | 结算日期,格式为yyyyMMdd |
currency | String | 8 | Yes | Yes | 结算币种。 请参阅 ISO 4217 货币代码 |
sign | String | / | Yes | No | 签名字符串,请参阅签名接口 |
文件内容说明
结算批次
名称 | 描述 |
---|---|
Settlement Date | 按结算周期计算的结算日期 |
Settlement Currency | 给商户结算的币种 |
Transaction Amount | 以结算币种计的交易金额 |
Refund Amount | 发生退款交易且退款成功的金额 |
Transaction Processing Fee | 支付交易收取的处理费 |
Refund Processing Fee | 退款交易收取的处理费 |
Fee | 支付交易收取的手续费 |
Interchange Fee | 仅在 IC++ 模式下有 |
Scheme Fee | 仅在 IC++ 模式下有 |
Markup | 仅在 IC++ 模式下有 |
Deposit Release | 返还的保证金金额 |
Deposit | 保证金金额,到期返还 |
Settlement Amount | 结算金额,即交易金额和手续费轧差后净额 |
Platform fee | 平台手续费 |
Fraud Administration Fee | 欺诈管理费 |
Decision management Fee | 风控决策管理费 |
结算明细
名称 | 描述 |
---|---|
Settlement Date | 按结算周期计算的结算日期 |
Settlement Batch ID | 结算批次号,一个结算批次只会有一个批次号 |
Transaction ID | 交易订单号 |
Merchant Order ID | 商户交易订单号 |
Production Type | 产品类型 |
Card Type | 卡类型或本地支付方式 |
APP ID | 商户应用程序 ID 。 商户注册网站时,OnerWay 会为商户创建一个应用id |
Transaction URL | 商户交易网站 |
Order_Currency | 交易订单币种 |
Order Amount | 交易订单金额 |
Transaction Type | / |
Transaction Status | / |
Settlement Currency | 给商户结算的币种 |
Transaction Amount | 以结算币种计的交易金额 |
Processing Fee | 处理费 |
Fee | 手续费 |
Interchange Fee | 仅在 IC++ 模式下有 |
Scheme Fee | 仅在 IC++ 模式下有 |
Markup | 仅在 IC++ 模式下有 |
Deposit | 保证金金额,到期返还 |
Settlement Amount | 每笔交易的结算金额,即交易金额和手续费轧差后净额 |
Settlement Status | 结算状态,结算成功/结算失败 |
Wallet Type Code | 钱包类型编码(目前仅在本地支付方式为Alipay+时有值) |
Merchant Order Time | 商户交易订单发生的时间 |
Platform type | 平台类型 |
Platform fee | 平台类型 |
Fraud Administration Fee | 欺诈管理费 |
Decision management Fee | 风控决策管理费 |
Fee Percentage | 手续费比例 |
Markup Fixed amount | Markup 固定金额 |
Markup Fixed currency | Markup 固定币种 |
Markup Percentage | Markup 费比例 |
Transaction complete time | 交易完成时间 |
card product | 卡类型 |
card category | 卡标识 |
交易类型
代码 | 描述 |
---|---|
SALE | 支付交易 |
REFUND | 退款交易 |
CB | 拒付交易 |
CB_CANCEL | 拒付撤销交易 |
CB_VOID | 拒付作废 |
CB_APPEAL | 拒付第一次申诉 |
CB_APPEAL_SUCCESS | 拒付第一次申诉成功 |
CB_APPEAL_SECOND | 拒付第二次申诉 |
CB_APPEAL_SECOND_SUCCESS | 拒付第二次申诉成功 |
CB_APPEAL_SECOND_FAILURE | 拒付第二次申诉失败 |
文件下载代码示例
GET
java
public void downLoad(@RequestParam("localFileName") String localFileName,HttpServletResponse response) {
HttpClient client = new HttpClient();
GetMethod get = null;
FileOutputStream output = null;
try {
get = new GetMethod("https://sandbox-acq.onerway.com/v1/settlementFile/download");
get.setRequestHeader("merchantNo", "500010");
get.setRequestHeader("date", "20211026");
get.setRequestHeader("currency", "USD");
get.setRequestHeader("sign","...");
MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams params = new HttpConnectionManagerParams();
params.setConnectionTimeout( 20000 );
params.setSoTimeout( 20000 );
connectionManager.setParams(params);
client = new HttpClient(connectionManager);
HttpClientParams clientParams = new HttpClientParams();
clientParams.setParameter("http.protocol.allow-circular-redirects", true);
clientParams.setParameter("http.protocol.max-redirects", 4);
client.setParams(clientParams);
int i = client.executeMethod(get);
if (200 == i) {
File storeFile = new File(localFileName);
output = new FileOutputStream(storeFile);
output.write(get.getResponseBody());
} else {
System.out.println("DownLoad file occurs exception, the error code is :" + i);
}
InputStream inStream = new FileInputStream(localFileName);
response.reset();
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + localFileName + "\"");
byte[] b = new byte[100];
int len;
try {
while ((len = inStream.read(b)) > 0)
response.getOutputStream().write(b, 0, len);
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if(output != null){
output.close();
}
} catch (IOException e) {
e.printStackTrace();
}
get.releaseConnection();
client.getHttpConnectionManager().closeIdleConnections(0);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55