package com.keao.edu.thirdparty.adapay; import com.alibaba.fastjson.JSON; import java.util.HashMap; import java.util.Map; /** * @author yingyong.wang */ public class Bill extends ConfigInit { /** * 运行账单下载接口 * @throws Exception 异常 */ public static void executeBillTest(String merchantKey) throws Exception{ Bill demo = new Bill(); Map download = demo.executeBillDownLoad(merchantKey); } /** * 运行账单下载接口 * @throws Exception 异常 */ public static void executeBillTest() throws Exception{ Bill demo = new Bill(); Map download = demo.executeBillDownLoad(); } /** * 执行一个下载对账文件操作 * @return 下载链接 * @throws Exception 异常 */ public Map executeBillDownLoad(String merchantKey) throws Exception { System.out.println("=======execute download begin======="); Map downloadParam = new HashMap(2); downloadParam.put("bill_date", "20190912"); Map download = com.huifu.adapay.model.Bill.download(downloadParam, merchantKey); String errorCode = (String)download.get("error_code"); if(null != errorCode){ System.out.println("对账单下载,请求参数:" + JSON.toJSONString(downloadParam)); System.out.println("对账单下载,返回参数:" + JSON.toJSONString(download)); }else{ System.out.println("对账单下载,成功"); } return download; } /** * 执行一个下载对账文件操作 * @return 下载链接 * @throws Exception 异常 */ public Map executeBillDownLoad() throws Exception { Map downloadParam = new HashMap(2); downloadParam.put("bill_date", "20190912"); Map download = com.huifu.adapay.model.Bill.download(downloadParam); String errorCode = (String)download.get("error_code"); if(null != errorCode){ System.out.println("对账单下载,请求参数:" + JSON.toJSONString(downloadParam)); System.out.println("对账单下载,返回参数:" + JSON.toJSONString(download)); }else{ System.out.println("对账单下载,成功"); } return download; } }