SettleAccount.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.keao.edu.thirdparty.adapay;
  2. import com.huifu.adapay.core.exception.BaseAdaPayException;
  3. import java.util.HashMap;
  4. import java.util.Map;
  5. public class SettleAccount {
  6. /**
  7. * 删除 SettleAccount
  8. *
  9. * @param settleCount_id 待删除的settleCount_id
  10. * @return delete的settleCount 对象
  11. * @throws Exception 异常
  12. */
  13. public static Map<String, Object> executeDeleteSettleAccount(String settleCount_id, String member_id) throws Exception {
  14. Map<String, Object> settleCountParams = new HashMap<String, Object>(3);
  15. settleCountParams.put("settle_account_id", settleCount_id);
  16. settleCountParams.put("member_id", member_id);
  17. settleCountParams.put("app_id", ConfigInit.appId);
  18. Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.delete(settleCountParams);
  19. String error_code = (String) settleCount.get("error_code");
  20. if (null != error_code) {
  21. String errorMsg = (String) settleCount.get("error_msg");
  22. throw new BaseAdaPayException(errorMsg);
  23. }
  24. return settleCount;
  25. }
  26. /**
  27. * 创建 settleCount
  28. *
  29. * @return 创建的settleCount 对象
  30. * @throws Exception 异常
  31. */
  32. public static Map<String, Object> executeCreateSettleAccount(String member_id, Map<String, Object> accountInfo) throws Exception {
  33. Map<String, Object> settleCountParams = new HashMap<String, Object>(4);
  34. settleCountParams.put("member_id", member_id);
  35. settleCountParams.put("app_id", ConfigInit.appId);
  36. settleCountParams.put("channel", "bank_account");
  37. settleCountParams.put("account_info", accountInfo);
  38. Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.create(settleCountParams);
  39. String error_code = (String) settleCount.get("error_code");
  40. if (null != error_code) {
  41. String errorMsg = (String) settleCount.get("error_msg");
  42. throw new BaseAdaPayException(errorMsg);
  43. }
  44. return settleCount;
  45. }
  46. }