Explorar o código

add ADApay member api

周箭河 %!s(int64=5) %!d(string=hai) anos
pai
achega
91399ac391

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/NotifyCallback.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.CorpMember;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
@@ -35,11 +36,14 @@ public class NotifyCallback implements MQTTCallbackHandler {
 
     private static NotifyCallback notifyCallback;
 
+    @Value("${spring.profiles.active}")
+    private String profiles;
+
     @PostConstruct
     public void init() {
         notifyCallback = this;
         String baseUrl = notifyCallback.sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-        if (!baseUrl.equals("https://mstuonline.dayaedu.com")) {
+        if (!profiles.equals("prod")) {
             Adapay.debug = true;
             /**
              * prodMode 模式,默认为生产模式,false可以使用mock模式

+ 0 - 134
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/AdapayTools.java

@@ -1,134 +0,0 @@
-package com.ym.mec.thirdparty.adapay;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.alibaba.fastjson.JSON;
-import com.huifu.adapay.model.Bill;
-import com.huifu.adapay.model.Login;
-
-/**
- * @author yingyong.wang
- */
-public class AdapayTools extends ConfigInit {
-
-    /**
-     * 获取银联用户号
-     *
-     * @throws Exception 异常
-     */
-    public static void executeToolsTest(String appId, String merchantKey) throws Exception {
-        Map<String, Object> unionParam = new HashMap<String, Object>(2);
-        unionParam.put("order_no", "20190912");
-        unionParam.put("app_id", appId);
-        unionParam.put("user_auth_code", "20190912");
-        unionParam.put("app_up_identifier", "20190912");
-        Map<String, Object> result = com.huifu.adapay.model.AdapayTools.unionUserId(unionParam, merchantKey);
-
-        String errorCode = (String) result.get("error_code");
-
-        if (null != errorCode) {
-
-            System.out.println("对账单下载,请求参数:" + JSON.toJSONString(unionParam));
-            System.out.println("对账单下载,返回参数:" + JSON.toJSONString(result));
-
-        } else {
-            System.out.println("对账单下载,成功");
-        }
-
-    }
-
-    /**
-     * 获取银联用户号
-     *
-     * @throws Exception 异常
-     */
-    public static void executeToolsTest(String appId) throws Exception {
-
-        Map<String, Object> unionParam = new HashMap<String, Object>(2);
-        unionParam.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
-        unionParam.put("app_id", appId);
-        unionParam.put("user_auth_code", "5yRGbi+IRda5khIQoQf1Hw==");
-        unionParam.put("app_up_identifier", "CloudPay");
-        Map<String, Object> result = com.huifu.adapay.model.AdapayTools.unionUserId(unionParam);
-        System.out.println("获取银联云闪付用户标识:" + JSON.toJSONString(result));
-        String errorCode = (String) result.get("error_code");
-
-        if (null != errorCode) {
-
-            System.out.println("获取银联云闪付用户标识,请求参数:" + JSON.toJSONString(unionParam));
-            System.out.println("获取银联云闪付用户标识,返回参数:" + JSON.toJSONString(result));
-
-        } else {
-            System.out.println("获取银联云闪付用户标识,成功");
-        }
-
-    }
-
-
-    /**
-     * 钱包登录申请
-     *
-     * @throws Exception 异常
-     */
-    public static void executeLoginTest(String appId, String merchantKey) throws Exception {
-        Map<String, Object> queryParams = new HashMap<String, Object>(5);
-        queryParams.put("ip", "127.0.0.1");
-        queryParams.put("member_id", "0");
-        //queryParams.put("member_id", "iris1234_14151");
-        queryParams.put("app_id", appId);
-        Map<String, Object> login = Login.login(queryParams, merchantKey);
-        if (login != null && "succeeded".equals(login.get("status"))) {
-            String formString = login.get("redirect_url").toString();
-            System.out.println("跳转地址:" + formString);
-        }
-
-    }
-
-    /**
-     * 钱包登录申请
-     *
-     * @throws Exception 异常
-     */
-    public static void executeLoginTest(String appId) throws Exception {
-        Map<String, Object> queryParams = new HashMap<String, Object>(5);
-        queryParams.put("ip", "127.0.0.1");
-        queryParams.put("member_id", "0");
-        //queryParams.put("member_id", "iris1234_14151");
-        queryParams.put("app_id", appId);
-        Map<String, Object> login = Login.login(queryParams);
-        if (login != null && "succeeded".equals(login.get("status"))) {
-            String formString = login.get("redirect_url").toString();
-            System.out.println("跳转地址:" + formString);
-        }
-
-    }
-
-    /**
-     * 执行一个下载对账文件操作
-     *
-     * @return 下载链接
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeBillDownLoad() throws Exception {
-
-
-        Map<String, Object> downloadParam = new HashMap<String, Object>(2);
-        downloadParam.put("bill_date", "20190912");
-
-        Map<String, Object> download = 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;
-    }
-
-}

+ 0 - 88
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Bill.java

@@ -1,88 +0,0 @@
-package com.ym.mec.thirdparty.adapay;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.alibaba.fastjson.JSON;
-
-/**
- * @author yingyong.wang
- */
-public class Bill extends ConfigInit {
-
-    /**
-     * 运行账单下载接口
-     * @throws Exception 异常
-     */
-    public static void executeBillTest(String merchantKey) throws Exception{
-        Bill demo = new Bill();
-        
-        Map<String, Object> download = demo.executeBillDownLoad(merchantKey);
-       
-    }
-
-    /**
-     * 运行账单下载接口
-     * @throws Exception 异常
-     */
-    public static void executeBillTest() throws Exception{
-        Bill demo = new Bill();
-        
-        Map<String, Object> download = demo.executeBillDownLoad();
-       
-    }
-
-    /**
-     * 执行一个下载对账文件操作
-     * @return 下载链接
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeBillDownLoad(String merchantKey) throws Exception {
-        System.out.println("=======execute download begin=======");
-
-        Map<String, Object> downloadParam = new  HashMap<String, Object>(2);
-        downloadParam.put("bill_date", "20190912");
-        Map<String, Object> 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<String, Object> executeBillDownLoad() throws Exception {
-        
-
-        Map<String, Object> downloadParam = new  HashMap<String, Object>(2);
-        downloadParam.put("bill_date", "20190912");
-        
-        Map<String, Object> 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;
-    }
-    
-}

+ 4 - 13
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/CorpMember.java

@@ -4,13 +4,12 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
-import com.alibaba.fastjson.JSON;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
 
 /**
  * @author
  */
-public class CorpMember extends ConfigInit {
+public class CorpMember {
 
     /**
      * 查询 CorpMember
@@ -20,17 +19,10 @@ public class CorpMember extends ConfigInit {
      * @throws Exception 异常
      */
     public static Map<String, Object> executeQueryMember(String member_id) throws Exception {
-        System.out.println("=======execute query CorpMember begin=======");
         Map<String, Object> memberParams = new HashMap<String, Object>(2);
         memberParams.put("member_id", member_id);
-        memberParams.put("app_id", appId);
-        System.out.println("查询企业用户,请求参数1:" + JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.CorpMember.query(memberParams);
-        System.out.println("查询企业用户,返回参数:" + JSON.toJSONString(member));
-
-        System.out.println("=======execute query CorpMember end=======");
-
-        return member;
+        memberParams.put("app_id", ConfigInit.appId);
+        return com.huifu.adapay.model.CorpMember.query(memberParams);
     }
 
     /**
@@ -40,9 +32,8 @@ public class CorpMember extends ConfigInit {
      * @throws Exception 异常
      */
     public static Map<String, Object> executeCreateMember(Map<String, Object> info, File file) throws Exception {
-        System.out.println("=======execute Create CorpMember begin=======");
         Map<String, Object> memberParams = new HashMap<String, Object>();
-        memberParams.put("app_id", appId);
+        memberParams.put("app_id", ConfigInit.appId);
         memberParams.putAll(info);
 
         Map<String, Object> member = com.huifu.adapay.model.CorpMember.create(memberParams, file);

+ 0 - 57
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/MainDemo.java

@@ -1,57 +0,0 @@
-package com.ym.mec.thirdparty.adapay;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class MainDemo {
-
-
-    public static void main(String[] args) throws Exception {
-        //多商户测试
-        //testMultiMerchant();
-
-        testMerchant();
-
-    }
-
-
-    public static void testMerchant() throws Exception {
-
-        HashMap<String, Object> memberParams = new HashMap<>();
-        memberParams.put("member_id", "W004201");
-        memberParams.put("order_no", "corp_mem_" + System.currentTimeMillis());
-
-        memberParams.put("social_credit_code", "91420106303461541T");
-        memberParams.put("social_credit_code_expires", "20440730");
-        memberParams.put("business_scope", "教育资讯、投资资讯");
-        memberParams.put("name", "武汉大雅乐盟教育咨询有限公司");
-        memberParams.put("prov_code", "0042");
-        memberParams.put("area_code", "4201");
-        memberParams.put("legal_person", "李松");
-        memberParams.put("legal_cert_id", "420106196811210837");
-        memberParams.put("legal_cert_id_expires", "20990730");
-        memberParams.put("legal_mp", "13958465215");//法人手机号
-        memberParams.put("address", "武昌区水果湖汉街武汉中央文化旅游区K3地块第2幢34层2号");
-        memberParams.put("zip_code", "430000");
-        //memberParams.put("telphone", "41164452");
-        // memberParams.put("email", "ceshi@qq.com");
-        memberParams.put("bank_code", "03020000");
-        memberParams.put("bank_acct_type", "1");
-        memberParams.put("card_no", "‘8111501011700649152");
-        memberParams.put("card_name", "武汉大雅");
-        //new CorpMember().executeCreateMember(memberParams);
-
-//        new CorpMember().executeQueryMember("W004201");
-
-
-        //Payment.closePayment("002112020062916385810123596334923411456");
-        //Map<String, Object> payment = Payment.queryPayment("002112020062914502410123569011751485440");
-
-
-        // 运行支付类接口
-        //String pamentId = Payment.executePaymentTest("default");
-
-    }
-
-}

+ 0 - 244
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Member.java

@@ -1,244 +0,0 @@
-package com.ym.mec.thirdparty.adapay;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.alibaba.fastjson.JSON;
-
-
-/**
- * @author yingyong.wang
- */
-public class Member extends ConfigInit {
-
-
-    /**
-     * 运行 member 类接口
-     * @throws Exception 异常
-     */
-    public static Map<String, Object> executeMemberTest(String merchantKey, String app_id) throws Exception{
-        Member demo = new Member();
-        Map<String, Object> member = demo.executeCreateMember(merchantKey, app_id);
-        demo.executeQueryMember(merchantKey, (String)member.get("member_id"),app_id);
-        demo.executeUpdateMember(merchantKey, (String)member.get("member_id"),app_id);
-        demo.executeQueryMember(merchantKey, (String)member.get("member_id"),app_id);
-        demo.executeListMember(merchantKey, app_id);
-        return member;
-    }
-
-
-    /**
-     * 创建 member
-     * @return 创建的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeCreateMember(String merchantKey, String app_id) throws Exception {
-        System.out.println("=======execute CreateMember begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", "jsdk_member_"+System.currentTimeMillis());
-        memberParams.put("app_id",app_id);
-        memberParams.put("location", "上海市徐汇区宜山路");
-        memberParams.put("email", "123@163.com");
-        memberParams.put("gender", "MALE");
-        memberParams.put("tel_no", "13153333333");
-        memberParams.put("nickname", "nick_name");
-        System.out.println("创建用户,请求参数:" + JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.create(memberParams, merchantKey);
-        System.out.println("创建用户,返回参数:" + JSON.toJSONString(member));
-        System.out.println("=======execute CreateMember end=======");
-        
-        return member;
-    
-    }
-
-    /**
-     * 查询 member
-     * @param member_id 待查询的member_id
-     * @return 创建的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQueryMember(String merchantKey, String member_id,String app_id) throws Exception {
-        System.out.println("=======execute queryMember begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", member_id);
-        memberParams.put("app_id", app_id);
-        System.out.println("查询用户,请求参数:" + JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.query(memberParams, merchantKey);
-        System.out.println("查询用户,返回参数:" + JSON.toJSONString(member));
-
-
-        System.out.println("=======execute queryMember end=======");
-        
-        return member;
-    
-    }
-
-
-    /**
-     * 更新 member
-     * @param member_id 待更新的member_id
-     * @return 更新的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeUpdateMember(String merchantKey, String member_id,String app_id) throws Exception {
-        System.out.println("=======execute update Member begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", member_id);
-        memberParams.put("app_id", app_id);
-        memberParams.put("location", "上海市徐汇区宜山路1");
-        memberParams.put("email", "1234@163.com");
-        memberParams.put("gender", "MALE");
-        memberParams.put("tel_no", "13153333333");
-        memberParams.put("nickname", "nick_name2");
-
-        System.out.println("更新用户,请求参数:"+JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.update(memberParams, merchantKey);
-        System.out.println("更新用户,返回参数:"+JSON.toJSONString(member));
-
-        System.out.println("=======execute update Member end=======");
-        
-        return member;
-    
-    }
-
-    /**
-     * 查询 member list
-     * @param app_id app_id
-     * @return 查询的member list
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeListMember(String merchantKey, String app_id) throws Exception {
-        System.out.println("=======execute list Member begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("page_index", "1");
-        memberParams.put("app_id", app_id);
-        memberParams.put("page_size", "20");
-        memberParams.put("created_gte", String.valueOf(System.currentTimeMillis() - 5 * 60 * 1000));
-        memberParams.put("created_lte", String.valueOf(System.currentTimeMillis()));
-        System.out.println("查询用户列表,请求参数:"+JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.queryList(memberParams, merchantKey);
-        System.out.println("查询用户列表,返回参数:"+JSON.toJSONString(member));
-
-
-        System.out.println("=======execute list Member end=======");
-        
-        return member;
-    
-    }
-
-     /**
-     * 运行 member 类接口
-     * @throws Exception 异常
-     */
-    public static Map<String, Object> executeMemberTest( String app_id) throws Exception{
-        Member demo = new Member();
-        Map<String, Object> member = demo.executeCreateMember( app_id);
-        demo.executeQueryMember( (String)member.get("member_id"),app_id);
-        demo.executeUpdateMember( (String)member.get("member_id"),app_id);
-        demo.executeQueryMember( (String)member.get("member_id"),app_id);
-        demo.executeListMember( app_id);
-        return member;
-    }
-
-
-    /**
-     * 创建 member
-     * @return 创建的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeCreateMember( String app_id) throws Exception {
-        System.out.println("=======execute CreateMember begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", "0021677");
-        memberParams.put("app_id",app_id);
-        memberParams.put("location", "上海市徐汇区宜山路");
-        memberParams.put("email", "123@163.com");
-        memberParams.put("gender", "MALE");
-        memberParams.put("tel_no", "13153333333");
-        memberParams.put("nickname", "nick_name");
-        System.out.println("创建用户,请求参数:" + JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.create(memberParams);
-        System.out.println("创建用户,返回参数:" + JSON.toJSONString(member));
-        System.out.println("=======execute CreateMember end=======");
-        
-        return member;
-    
-    }
-
-    /**
-     * 查询 member
-     * @param member_id 待查询的member_id
-     * @return 创建的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQueryMember( String member_id,String app_id) throws Exception {
-        System.out.println("=======execute queryMember begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", member_id);
-        memberParams.put("app_id", app_id);
-        System.out.println("查询用户,请求参数:" + JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.query(memberParams);
-        System.out.println("查询用户,返回参数:" + JSON.toJSONString(member));
-
-
-        System.out.println("=======execute queryMember end=======");
-        
-        return member;
-    
-    }
-
-
-    /**
-     * 更新 member
-     * @param member_id 待更新的member_id
-     * @return 更新的member 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeUpdateMember( String member_id,String app_id) throws Exception {
-        System.out.println("=======execute update Member begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("member_id", member_id);
-        memberParams.put("app_id", app_id);
-        memberParams.put("location", "上海市徐汇区宜山路1");
-        memberParams.put("email", "1234@163.com");
-        memberParams.put("gender", "MALE");
-        memberParams.put("tel_no", "13153333333");
-        memberParams.put("nickname", "nick_name2");
-
-        System.out.println("更新用户,请求参数:"+JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.update(memberParams);
-        System.out.println("更新用户,返回参数:"+JSON.toJSONString(member));
-
-        System.out.println("=======execute update Member end=======");
-        
-        return member;
-    
-    }
-
-    /**
-     * 查询 member list
-     * @param app_id app_id
-     * @return 查询的member list
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeListMember( String app_id) throws Exception {
-        System.out.println("=======execute list Member begin=======");
-        Map<String, Object> memberParams = new  HashMap<String, Object>(2);
-        memberParams.put("page_index", "1");
-        memberParams.put("app_id", app_id);
-        memberParams.put("page_size", "20");
-        memberParams.put("created_gte", String.valueOf(System.currentTimeMillis() - 5 * 60 * 1000));
-        memberParams.put("created_lte", String.valueOf(System.currentTimeMillis()));
-        System.out.println("查询用户列表,请求参数:"+JSON.toJSONString(memberParams));
-        Map<String, Object> member = com.huifu.adapay.model.Member.queryList(memberParams);
-        System.out.println("查询用户列表,返回参数:"+JSON.toJSONString(member));
-
-
-        System.out.println("=======execute list Member end=======");
-        
-        return member;
-    
-    }
-
-
-}

+ 5 - 5
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Payment.java

@@ -8,7 +8,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
 import org.springframework.util.DigestUtils;
 
-public class Payment extends ConfigInit {
+public class Payment {
     /**
      * 执行一个支付交易
      *
@@ -16,7 +16,7 @@ public class Payment extends ConfigInit {
      * @throws Exception 异常
      */
     public static Map<String, Object> executePayment(Map<String, Object> paymentParams) throws Exception {
-        paymentParams.put("app_id", appId);
+        paymentParams.put("app_id", ConfigInit.appId);
 
         //调用sdk方法,创建支付,得到支付对象
         Map<String, Object> payment = new HashMap<>();
@@ -118,20 +118,20 @@ public class Payment extends ConfigInit {
 
     public static Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, String sellerNo, List<Map<String, Object>> tempRoutingList) throws Exception {
         Map<String, Object> paymentParams = new LinkedHashMap<>();
-        paymentParams.put("appId", appId);
+        paymentParams.put("appId", ConfigInit.appId);
         paymentParams.put("amount", amount.setScale(2, BigDecimal.ROUND_HALF_UP));
         paymentParams.put("orderNo", orderNo);
 //        paymentParams.put("notifyUrl", notifyUrl);
 //        paymentParams.put("returnUrl", returnUrl);
         paymentParams.put("orderSubject", orderSubject);
         paymentParams.put("orderBody", orderBody);
-        paymentParams.put("wxAppId", wxAppId);
+        paymentParams.put("wxAppId", ConfigInit.wxAppId);
 
         String originalStr = JSONObject.toJSONString(paymentParams);
         String sign = DigestUtils.md5DigestAsHex(originalStr.getBytes());
 
         paymentParams.put("sign", sign);
-        paymentParams.remove(appId);
+        paymentParams.remove("appId");
         return paymentParams;
     }
 }

+ 0 - 153
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Refund.java

@@ -1,153 +0,0 @@
-package com.ym.mec.thirdparty.adapay;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import com.alibaba.fastjson.JSON;
-
-public class Refund extends ConfigInit {
-
-    /**
-     * 运行退款类接口
-     *
-     * @throws Exception 异常
-     */
-    public static void executeRefundTest(String merchantKey, String paymentId) throws Exception {
-        Refund demo = new Refund();
-        //退款接口
-        Map<String, Object> refund = demo.executeRefund(merchantKey, paymentId);
-        //退款查询接口(通过pamentId查询)
-        demo.queryByPaymentId(merchantKey, paymentId);
-        //退款查询接口(通过refundId查询)
-        demo.queryByRefundId(merchantKey, (String) refund.get("id"));
-    }
-
-    /**
-     * 执行一个退款交易
-     *
-     * @param paymentId 要退款的原支付paymentId
-     * @return 创建的退款对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeRefund(String merchantKey, String paymentId) throws Exception {
-        System.out.println("=======execute refund begin=======");
-        Map<String, Object> refundParams = new HashMap<String, Object>(2);
-        refundParams.put("refund_amt", "0.01");
-        refundParams.put("app_id", "your appid");
-        refundParams.put("refund_order_no", "jsdk_refund_"+System.currentTimeMillis());
-        System.out.println("退款请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.create(paymentId, refundParams, merchantKey);
-        System.out.println("退款返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======execute refund end=======");
-        
-        return refund;
-    }
-
-    /**
-     * 根据原支付id查询一个退款交易
-     *
-     * @param paymentId 要查询退款的原支付paymentId
-     * @return 查询的退款对象,可能含多个退款明细RefundDetail
-     * @throws Exception 异常
-     */
-    public Map<String, Object> queryByPaymentId(String merchantKey, String paymentId) throws Exception {
-        System.out.println("=======query refund by paymentId begin=======");
-        Map<String, Object> refundParams = new  HashMap<String, Object>(1);
-        refundParams.put("payment_id", paymentId);
-        System.out.println("通过原支付ID查询退款交易,请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.query(refundParams, merchantKey);
-        System.out.println("通过原支付ID查询退款交易,返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======query refund by paymentId end=======");
-        return refund;
-    }
-
-    /**
-     * 根据退款refundId查询一个退款交易
-     *
-     * @param refundId 要查询的退款refundId
-     * @return 查询的退款对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> queryByRefundId(String merchantKey, String refundId) throws Exception {
-        System.out.println("=======query refund by refundid begin=======");
-        Map<String, Object> refundParams = new  HashMap<String, Object>(1);
-        refundParams.put("refund_id", refundId);
-        System.out.println("通过refundId查询退款交易,请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.query(refundParams, merchantKey);
-        System.out.println("通过refundId查询退款交易,返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======query refund by refundid end=======");
-        return refund;
-    }
-
-    /**
-     * 运行退款类接口
-     *
-     * @throws Exception 异常
-     */
-    public static void executeRefundTest( String paymentId) throws Exception {
-        Refund demo = new Refund();
-        //退款接口
-        Map<String, Object> refund = demo.executeRefund( paymentId);
-        //退款查询接口(通过pamentId查询)
-        demo.queryByPaymentId( paymentId);
-        //退款查询接口(通过refundId查询)
-        demo.queryByRefundId( (String) refund.get("id"));
-    }
-
-    /**
-     * 执行一个退款交易
-     *
-     * @param paymentId 要退款的原支付paymentId
-     * @return 创建的退款对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeRefund( String paymentId) throws Exception {
-        System.out.println("=======execute refund begin=======");
-        Map<String, Object> refundParams = new HashMap<String, Object>(2);
-        refundParams.put("refund_amt", "0.01");
-        refundParams.put("app_id", "your appid");
-        refundParams.put("refund_order_no", "jsdk_refund_"+System.currentTimeMillis());
-        System.out.println("退款请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.create(paymentId, refundParams);
-        System.out.println("退款返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======execute refund end=======");
-        
-        return refund;
-    }
-
-    /**
-     * 根据原支付id查询一个退款交易
-     *
-     * @param paymentId 要查询退款的原支付paymentId
-     * @return 查询的退款对象,可能含多个退款明细RefundDetail
-     * @throws Exception 异常
-     */
-    public Map<String, Object> queryByPaymentId( String paymentId) throws Exception {
-        System.out.println("=======query refund by paymentId begin=======");
-        Map<String, Object> refundParams = new  HashMap<String, Object>(1);
-        refundParams.put("payment_id", paymentId);
-        System.out.println("通过原支付ID查询退款交易,请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.query(refundParams);
-        System.out.println("通过原支付ID查询退款交易,返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======query refund by paymentId end=======");
-        return refund;
-    }
-
-    /**
-     * 根据退款refundId查询一个退款交易
-     *
-     * @param refundId 要查询的退款refundId
-     * @return 查询的退款对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> queryByRefundId( String refundId) throws Exception {
-        System.out.println("=======query refund by refundid begin=======");
-        Map<String, Object> refundParams = new  HashMap<String, Object>(1);
-        refundParams.put("refund_id", refundId);
-        System.out.println("通过refundId查询退款交易,请求参数:" + JSON.toJSONString(refundParams));
-        Map<String, Object> refund = com.huifu.adapay.model.Refund.query(refundParams);
-        System.out.println("通过refundId查询退款交易,返回参数:" + JSON.toJSONString(refund));
-        System.out.println("=======query refund by refundid end=======");
-        return refund;
-    }
-}

+ 3 - 450
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/SettleAccount.java

@@ -3,456 +3,9 @@ package com.ym.mec.thirdparty.adapay;
 import java.util.HashMap;
 import java.util.Map;
 
-import com.alibaba.fastjson.JSON;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
 
-/**
- * @author yingyong.wang
- */
-public class SettleAccount extends ConfigInit {
-
-    /**
-     * 运行结算账户类接口
-     *
-     * @throws Exception 异常
-     */
-    public static void executeSettleAccountTest(String merchantKey, String app_id, String member_id) throws Exception {
-        SettleAccount demo = new SettleAccount();
-        // 创建结算账户
-        Map<String, Object> settlecount = demo.executeCreateSettleAccount(merchantKey, app_id, member_id);
-        String settleCount_id = (String) settlecount.get("id");
-
-
-        // 查询结算账户
-        demo.executeQuerySettleAccount(merchantKey, settleCount_id, app_id, member_id);
-
-        // 查询结算账户明细列表
-        demo.executeQuerySettleDetails(merchantKey, app_id, member_id, settleCount_id);
-        // 删除结算账户
-        demo.executeDeleteSettleAccount(merchantKey, settleCount_id, app_id, member_id);
-
-        member_id = "user_test_10001";
-        settleCount_id = "0023056905335360";
-
-        demo.executeModifySettleAccount(merchantKey, settleCount_id, app_id, member_id);
-
-        demo.executeDrawCash(merchantKey, app_id, member_id);
-
-        demo.executeQueryBalance(merchantKey, app_id, member_id, settleCount_id);
-    }
-
-    /**
-     * 运行查询结算明细列表接口
-     *
-     * @throws Exception 异常
-     */
-//    public static void executeQuerySettleDetailTest(String merchantKey, String appId, String memberId, String settleAccountId, String beginDate, String endDate) throws Exception {
-//        SettleAccountDemo demo = new SettleAccountDemo();
-//        demo.executeQuerySettleDetails(merchantKey, appId, memberId, settleAccountId, beginDate, endDate);
-//    }
-
-
-    /**
-     * 创建 settleCount
-     *
-     * @return 创建的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeCreateSettleAccount(String merchantKey, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute Create SettleAccount begin=======");
-        Map<String, Object> settleCountParams = new HashMap<String, Object>(2);
-        Map<String, Object> accountInfo = new HashMap<String, Object>(2);
-        accountInfo.put("card_id", "6222021703001692221");
-        accountInfo.put("card_name", "袁电茜");
-        accountInfo.put("cert_id", "310109200006062491");
-        accountInfo.put("cert_type", "00");
-        accountInfo.put("tel_no", "18888888881");
-        accountInfo.put("bank_code", "03060000");
-        accountInfo.put("bank_acct_type", "1");
-        accountInfo.put("prov_code", "0031");
-        accountInfo.put("area_code", "3100");
-        settleCountParams.put("member_id", member_id);
-        settleCountParams.put("app_id", app_id);
-        settleCountParams.put("channel", "bank_account");
-        settleCountParams.put("account_info", accountInfo);
-        System.out.println("创建结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.create(settleCountParams, merchantKey);
-        System.out.println("创建结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute Create SettleAccount end=======");
-
-        return settleCount;
-
-    }
-
-    /**
-     * 查询 SettleAccount
-     *
-     * @param settleCount_id 待查询的settleCount_id
-     * @param app_id         app_id
-     * @return 查询的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQuerySettleAccount(String merchantKey, String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute query SettleAccount begin=======");
-        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", app_id);
-        System.out.println("查询结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.query(settleCountParams, merchantKey);
-        System.out.println("查询结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute query SettleAccount end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 删除 SettleAccount
-     *
-     * @param settleCount_id 待删除的settleCount_id
-     * @param app_id         app_id
-     * @return delete的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeDeleteSettleAccount(String merchantKey, String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute delete SettleAccount begin=======");
-        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", app_id);
-        System.out.println("删除结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.delete(settleCountParams, merchantKey);
-        System.out.println("删除结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute delete SettleAccount end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 查询结算明细列表
-     *
-     * @param merchantKey
-     * @param app_id          app_id
-     * @param member_id       待查询的member_id
-     * @param settleAccountId 待查询的settleAccountId
-     * @return
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQuerySettleDetails(String merchantKey, String app_id, String member_id,
-                                                         String settleAccountId) throws Exception {
-        System.out.println("=======execute query settle details begin=======");
-        Map<String, Object> querySettleDetailParams = new HashMap<String, Object>(2);
-        querySettleDetailParams.put("app_id", app_id);
-        querySettleDetailParams.put("member_id", member_id);
-        querySettleDetailParams.put("settle_account_id", settleAccountId);
-        querySettleDetailParams.put("begin_date", "20191008");
-        querySettleDetailParams.put("end_date", "20191010");
-        System.out.println("查询结算明细列表,请求参数:" + JSON.toJSONString(querySettleDetailParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.querySettleDetails(querySettleDetailParams, merchantKey);
-        System.out.println("查询结算明细列表,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute query settle details end=======");
-
-        return settleCount;
-    }
-
-
-    /**
-     * 运行结算账户类接口
-     *
-     * @throws Exception 异常
-     */
-    public static void executeSettleAccountTest(String app_id, String member_id) throws Exception {
-        SettleAccount demo = new SettleAccount();
-        // 创建结算账户
-        Map<String, Object> settlecount = demo.executeCreateSettleAccount(app_id, member_id);
-        String settleCount_id = (String) settlecount.get("id");
-        // 查询结算账户
-        demo.executeQuerySettleAccount(settleCount_id, app_id, member_id);
-
-        // 查询结算账户明细列表
-        demo.executeQuerySettleDetails(app_id, member_id, settleCount_id);
-        // 删除结算账户
-        demo.executeDeleteSettleAccount(settleCount_id, app_id, member_id);
-        member_id = "user_test_10001";
-        settleCount_id = "0023056905335360";
-
-        demo.executeModifySettleAccount(settleCount_id, app_id, member_id);
-
-    }
-
-    /**
-     * 运行查询结算明细列表接口
-     *
-     * @throws Exception 异常
-     */
-//    public static void executeQuerySettleDetailTest( String appId, String memberId, String settleAccountId, String beginDate, String endDate) throws Exception {
-//        SettleAccountDemo demo = new SettleAccountDemo();
-//        demo.executeQuerySettleDetails( appId, memberId, settleAccountId, beginDate, endDate);
-//    }
-
-
-    /**
-     * 创建 settleCount
-     *
-     * @return 创建的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeCreateSettleAccount(String app_id, String member_id) throws Exception {
-        System.out.println("=======execute Create SettleAccount begin=======");
-        Map<String, Object> settleCountParams = new HashMap<String, Object>(2);
-        Map<String, Object> accountInfo = new HashMap<String, Object>(2);
-        accountInfo.put("card_id", "6222021703001692221");
-        accountInfo.put("card_name", "袁电茜");
-        accountInfo.put("cert_id", "310109200006062491");
-        accountInfo.put("cert_type", "00");
-        accountInfo.put("tel_no", "18888888881");
-        accountInfo.put("bank_code", "03060000");
-        accountInfo.put("bank_acct_type", "1");
-        accountInfo.put("prov_code", "0031");
-        accountInfo.put("area_code", "3100");
-        settleCountParams.put("member_id", member_id);
-        settleCountParams.put("app_id", app_id);
-        settleCountParams.put("channel", "bank_account");
-        settleCountParams.put("account_info", accountInfo);
-        System.out.println("创建结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.create(settleCountParams);
-        System.out.println("创建结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute Create SettleAccount end=======");
-
-        return settleCount;
-
-    }
-
-    /**
-     * 查询 SettleAccount
-     *
-     * @param settleCount_id 待查询的settleCount_id
-     * @param app_id         app_id
-     * @return 查询的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQuerySettleAccount(String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute query SettleAccount begin=======");
-        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", app_id);
-        System.out.println("查询结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.query(settleCountParams);
-        System.out.println("查询结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute query SettleAccount end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 修改 SettleAccount
-     *
-     * @param settleCount_id 待修改的settleCount_id
-     * @param app_id         app_id
-     * @return 修改的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeModifySettleAccount(String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute modify SettleAccount begin=======");
-        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", app_id);
-
-        settleCountParams.put("min_amt", "0.10");
-        settleCountParams.put("remained_amt", "0.10");
-        System.out.println("修改结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.modify(settleCountParams);
-        System.out.println("修改结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute modify SettleAccount end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 修改 SettleAccount
-     *
-     * @param settleCount_id 待修改的settleCount_id
-     * @param app_id         app_id
-     * @return 修改的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeModifySettleAccount(String merchantKey, String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute modify SettleAccount begin=======");
-        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", app_id);
-        settleCountParams.put("min_amt", "");
-        settleCountParams.put("remained_amt", "");
-
-        System.out.println("修改结算账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.modify(settleCountParams, merchantKey);
-        System.out.println("修改结算账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute modify SettleAccount end=======");
-
-        return settleCount;
-    }
-
-
-    /**
-     * 删除 SettleAccount
-     *
-     * @param settleCount_id 待删除的settleCount_id
-     * @param app_id         app_id
-     * @return delete的settleCount 对象
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeDeleteSettleAccount(String settleCount_id, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute delete SettleAccount begin=======");
-        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", app_id);
-        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=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 查询结算明细列表
-     *
-     * @param app_id          app_id
-     * @param member_id       待查询的member_id
-     * @param settleAccountId 待查询的settleAccountId
-     * @return
-     * @throws Exception 异常
-     */
-    public Map<String, Object> executeQuerySettleDetails(String app_id, String member_id,
-                                                         String settleAccountId) throws Exception {
-        System.out.println("=======execute query settle details begin=======");
-        Map<String, Object> querySettleDetailParams = new HashMap<String, Object>(2);
-        querySettleDetailParams.put("app_id", app_id);
-        querySettleDetailParams.put("member_id", member_id);
-        querySettleDetailParams.put("settle_account_id", settleAccountId);
-        querySettleDetailParams.put("begin_date", "20191008");
-        querySettleDetailParams.put("end_date", "20191010");
-        System.out.println("查询结算明细列表,请求参数:" + JSON.toJSONString(querySettleDetailParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.querySettleDetails(querySettleDetailParams);
-        System.out.println("查询结算明细列表,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute query settle details end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 取现
-     *
-     * @param merchantKey
-     * @param app_id
-     * @param member_id
-     * @return
-     * @throws Exception
-     */
-    public static Map<String, Object> executeDrawCash(String merchantKey, String app_id, String member_id) throws Exception {
-        System.out.println("=======execute modify SettleAccount begin=======");
-        Map<String, Object> settleCountParams = new HashMap<String, Object>();
-
-        settleCountParams.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
-        settleCountParams.put("cash_amt", "0.01");
-        settleCountParams.put("member_id", "user_00008");
-        settleCountParams.put("app_id", app_id);
-        // settleCountParams.put("settle_account_id", "0008919797515968");
-        settleCountParams.put("cash_type", "T1");
-        settleCountParams.put("notify_url", "");
-
-        System.out.println("取现接口,请求参数:" + JSON.toJSONString(settleCountParams));
-        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=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 查询余额
-     *
-     * @param merchantKey
-     * @param app_id
-     * @param member_id
-     * @param settleCount_id
-     * @return
-     * @throws Exception
-     */
-    public static Map<String, Object> executeQueryBalance(String merchantKey, 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>();
-
-        settleCountParams.put("app_id", app_id);
-        settleCountParams.put("member_id", "user_00008");
-        settleCountParams.put("settle_account_id", "0035172521665088");
-
-
-        System.out.println("查询余额账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        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
-     * @throws Exception
-     */
-    public static Map<String, Object> executeDrawCash(String app_id, String member_id) throws Exception {
-        System.out.println("=======execute modify SettleAccount begin=======");
-        Map<String, Object> settleCountParams = new HashMap<String, Object>();
-
-        settleCountParams.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
-        settleCountParams.put("cash_amt", "0.01");
-        settleCountParams.put("member_id", "user_00008");
-        settleCountParams.put("app_id", app_id);
-        // settleCountParams.put("settle_account_id", "0008919797515968");
-        settleCountParams.put("cash_type", "T1");
-        settleCountParams.put("notify_url", "");
-
-        System.out.println("取现接口,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.drawCash(settleCountParams);
-        System.out.println("取现接口返回参数" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute modify SettleAccount end=======");
-
-        return settleCount;
-    }
-
-    /**
-     * 查询余额
-     *
-     * @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 {
-        System.out.println("=======execute modify SettleAccount begin=======");
-        Map<String, Object> settleCountParams = new HashMap<String, Object>();
-
-        settleCountParams.put("app_id", app_id);
-        settleCountParams.put("member_id", "user_00008");
-        settleCountParams.put("settle_account_id", "0035172521665088");
-
-
-        System.out.println("查询余额账户,请求参数:" + JSON.toJSONString(settleCountParams));
-        Map<String, Object> settleCount = com.huifu.adapay.model.SettleAccount.queryBalance(settleCountParams);
-        System.out.println("查询余额账户,返回参数:" + JSON.toJSONString(settleCount));
-        System.out.println("=======execute modify SettleAccount end=======");
-
-        return settleCount;
-    }
+public class SettleAccount {
 
     /**
      * 删除 SettleAccount
@@ -462,7 +15,7 @@ public class SettleAccount extends ConfigInit {
      * @throws Exception 异常
      */
     public static Map<String, Object> executeDeleteSettleAccount(String settleCount_id, String member_id) throws Exception {
-        Map<String, Object> settleCountParams = new HashMap<String, Object>(2);
+        Map<String, Object> settleCountParams = new HashMap<String, Object>(3);
         settleCountParams.put("settle_account_id", settleCount_id);
         settleCountParams.put("member_id", member_id);
         settleCountParams.put("app_id", ConfigInit.appId);
@@ -483,7 +36,7 @@ public class SettleAccount extends ConfigInit {
      * @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);
+        Map<String, Object> settleCountParams = new HashMap<String, Object>(4);
         settleCountParams.put("member_id", member_id);
         settleCountParams.put("app_id", ConfigInit.appId);
         settleCountParams.put("channel", "bank_account");