|
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.huifu.adapay.core.exception.BaseAdaPayException;
|
|
|
|
|
|
/**
|
|
|
* @author yingyong.wang
|
|
@@ -365,7 +366,7 @@ public class SettleAccount extends ConfigInit {
|
|
|
settleCountParams.put("notify_url", "");
|
|
|
|
|
|
System.out.println("取现接口,请求参数:" + JSON.toJSONString(settleCountParams));
|
|
|
- Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.drawCash(settleCountParams,merchantKey);
|
|
|
+ Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.drawCash(settleCountParams, merchantKey);
|
|
|
System.out.println("取现接口返回参数" + JSON.toJSONString(settleCount));
|
|
|
System.out.println("=======execute modify SettleAccount end=======");
|
|
|
|
|
@@ -392,16 +393,16 @@ public class SettleAccount extends ConfigInit {
|
|
|
|
|
|
|
|
|
System.out.println("查询余额账户,请求参数:" + JSON.toJSONString(settleCountParams));
|
|
|
- Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.queryBalance(settleCountParams,merchantKey);
|
|
|
+ Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.queryBalance(settleCountParams, merchantKey);
|
|
|
System.out.println("查询余额账户,返回参数:" + JSON.toJSONString(settleCount));
|
|
|
System.out.println("=======execute modify SettleAccount end=======");
|
|
|
|
|
|
return settleCount;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 取现
|
|
|
*
|
|
|
-
|
|
|
* @param app_id
|
|
|
* @param member_id
|
|
|
* @return
|
|
@@ -430,14 +431,13 @@ public class SettleAccount extends ConfigInit {
|
|
|
/**
|
|
|
* 查询余额
|
|
|
*
|
|
|
-
|
|
|
* @param app_id
|
|
|
* @param member_id
|
|
|
* @param settleCount_id
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static Map<String, Object> executeQueryBalance( String app_id, String member_id, String settleCount_id) throws Exception {
|
|
|
+ public static Map<String, Object> executeQueryBalance(String app_id, String member_id, String settleCount_id) throws Exception {
|
|
|
System.out.println("=======execute modify SettleAccount begin=======");
|
|
|
Map<String, Object> settleCountParams = new HashMap<String, Object>();
|
|
|
|
|
@@ -461,16 +461,39 @@ public class SettleAccount extends ConfigInit {
|
|
|
* @return delete的settleCount 对象
|
|
|
* @throws Exception 异常
|
|
|
*/
|
|
|
- public Map<String, Object> executeDeleteSettleAccount(String settleCount_id, String member_id) throws Exception {
|
|
|
- System.out.println("=======execute delete SettleAccount begin=======");
|
|
|
+ public static Map<String, Object> executeDeleteSettleAccount(String settleCount_id, String member_id) throws Exception {
|
|
|
Map<String, Object> settleCountParams = new HashMap<String, Object>(2);
|
|
|
settleCountParams.put("settle_account_id", settleCount_id);
|
|
|
settleCountParams.put("member_id", member_id);
|
|
|
settleCountParams.put("app_id", ConfigInit.appId);
|
|
|
- System.out.println("删除结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
|
|
|
Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.delete(settleCountParams);
|
|
|
- System.out.println("删除结算账户,返回参数:" + JSON.toJSONString(settleCount));
|
|
|
- System.out.println("=======execute delete SettleAccount end=======");
|
|
|
+ String error_code = (String) settleCount.get("error_code");
|
|
|
+ if (null != error_code) {
|
|
|
+ String errorMsg = (String) settleCount.get("error_msg");
|
|
|
+ throw new BaseAdaPayException(errorMsg);
|
|
|
+ }
|
|
|
+ return settleCount;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建 settleCount
|
|
|
+ *
|
|
|
+ * @return 创建的settleCount 对象
|
|
|
+ * @throws Exception 异常
|
|
|
+ */
|
|
|
+ public static Map<String, Object> executeCreateSettleAccount(String member_id, Map<String, Object> accountInfo) throws Exception {
|
|
|
+ Map<String, Object> settleCountParams = new HashMap<String, Object>(2);
|
|
|
+ settleCountParams.put("member_id", member_id);
|
|
|
+ settleCountParams.put("app_id", ConfigInit.appId);
|
|
|
+ settleCountParams.put("channel", "bank_account");
|
|
|
+ settleCountParams.put("account_info", accountInfo);
|
|
|
+ Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.create(settleCountParams);
|
|
|
+ String error_code = (String) settleCount.get("error_code");
|
|
|
+ if (null != error_code) {
|
|
|
+ String errorMsg = (String) settleCount.get("error_msg");
|
|
|
+ throw new BaseAdaPayException(errorMsg);
|
|
|
+ }
|
|
|
return settleCount;
|
|
|
}
|
|
|
|