Bill.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.keao.edu.thirdparty.adapay;
  2. import com.alibaba.fastjson.JSON;
  3. import java.util.HashMap;
  4. import java.util.Map;
  5. /**
  6. * @author yingyong.wang
  7. */
  8. public class Bill extends ConfigInit {
  9. /**
  10. * 运行账单下载接口
  11. * @throws Exception 异常
  12. */
  13. public static void executeBillTest(String merchantKey) throws Exception{
  14. Bill demo = new Bill();
  15. Map<String, Object> download = demo.executeBillDownLoad(merchantKey);
  16. }
  17. /**
  18. * 运行账单下载接口
  19. * @throws Exception 异常
  20. */
  21. public static void executeBillTest() throws Exception{
  22. Bill demo = new Bill();
  23. Map<String, Object> download = demo.executeBillDownLoad();
  24. }
  25. /**
  26. * 执行一个下载对账文件操作
  27. * @return 下载链接
  28. * @throws Exception 异常
  29. */
  30. public Map<String, Object> executeBillDownLoad(String merchantKey) throws Exception {
  31. System.out.println("=======execute download begin=======");
  32. Map<String, Object> downloadParam = new HashMap<String, Object>(2);
  33. downloadParam.put("bill_date", "20190912");
  34. Map<String, Object> download = com.huifu.adapay.model.Bill.download(downloadParam, merchantKey);
  35. String errorCode = (String)download.get("error_code");
  36. if(null != errorCode){
  37. System.out.println("对账单下载,请求参数:" + JSON.toJSONString(downloadParam));
  38. System.out.println("对账单下载,返回参数:" + JSON.toJSONString(download));
  39. }else{
  40. System.out.println("对账单下载,成功");
  41. }
  42. return download;
  43. }
  44. /**
  45. * 执行一个下载对账文件操作
  46. * @return 下载链接
  47. * @throws Exception 异常
  48. */
  49. public Map<String, Object> executeBillDownLoad() throws Exception {
  50. Map<String, Object> downloadParam = new HashMap<String, Object>(2);
  51. downloadParam.put("bill_date", "20190912");
  52. Map<String, Object> download = com.huifu.adapay.model.Bill.download(downloadParam);
  53. String errorCode = (String)download.get("error_code");
  54. if(null != errorCode){
  55. System.out.println("对账单下载,请求参数:" + JSON.toJSONString(downloadParam));
  56. System.out.println("对账单下载,返回参数:" + JSON.toJSONString(download));
  57. }else{
  58. System.out.println("对账单下载,成功");
  59. }
  60. return download;
  61. }
  62. }