提交 c36e3c41 authored 作者: aiqingguo's avatar aiqingguo

银行测试

上级 a5fb17e4
...@@ -44,66 +44,72 @@ public class TempBankController { ...@@ -44,66 +44,72 @@ public class TempBankController {
private void bankTest() throws Exception { private void bankTest() throws Exception {
String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ"; String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ";
log.info("path:{}", TempBankController.class.getClassLoader().getResource("").getPath());
OpenSDK.init(TempBankController.class.getClassLoader().getResource("config.properties").getPath(), priKey); OpenSDK.init(TempBankController.class.getClassLoader().getResource("config.properties").getPath(), priKey);
String res1 = OpenSDK.sendFile("", "open-filegateway",TempBankController.class.getClassLoader().getResource("bank.txt").getPath()); String res1 = OpenSDK.sendFile("", "open-filegateway",TempBankController.class.getClassLoader().getResource("bank.txt").getPath());
log.info("url:{}", res1);
} }
public static void main(String[] args) {
try {
callBySepJson();
//demo.callByBean();
} catch (Exception e) {
e.printStackTrace();
}
}
//商户私钥
private static String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ";
static {
// // 初始化(只需在系统启动时初始化一次,config.properties的路径可以是绝对路径,也可以是当前工程的相对路径)
// URL resource = TempBankController.class.getClassLoader().getResource("config.properties");
// String path = resource.getPath();
// //
// public static void main(String[] args) { // System.out.println(TempBankController.class.getClassLoader().getResource("config.properties").getPath());
//
// try { System.out.println(TempBankController.class.getClassLoader().getResource("").getPath());
// callBySepJson();
// //demo.callByBean();
// } catch (Exception e) { OpenSDK.init(TempBankController.class.getClassLoader().getResource("config.properties").getPath(), priKey);
// e.printStackTrace(); }
// }
// } /**
// * @throws Exception
// private static Log log = LogFactory.getLog(Demo.class); */
// //商户私钥 public static void callBySepJson() throws Exception {
// private static String priKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ"; /*
// static { * dataJson 是放置具体交易请求业务报文,dataJson报文结构如下: {"Data":{"app_name":"1"}}
//// // 初始化(只需在系统启动时初始化一次,config.properties的路径可以是绝对路径,也可以是当前工程的相对路径) */
//// URL resource = TempBankController.class.getClassLoader().getResource("config.properties"); // String dataJson="";
//// String path = resource.getPath(); // // 发送请求并获取响应(第一个填入productId,第二个填入serviceId)
//// // String res = OpenSDK.send("", "", dataJson);
//// System.out.println(TempBankController.class.getClassLoader().getResource("config.properties").getPath()); // if (log.isDebugEnabled()) {
// // log.debug("res: " + res);
// OpenSDK.init(TempBankController.class.getClassLoader().getResource("config.properties").getPath(), priKey);
// }
//
// /**
// * @throws Exception
// */
// public static void callBySepJson() throws Exception {
// /*
// * dataJson 是放置具体交易请求业务报文,dataJson报文结构如下: {"Data":{"app_name":"1"}}
// */
//// String dataJson="";
//// // 发送请求并获取响应(第一个填入productId,第二个填入serviceId)
//// String res = OpenSDK.send("", "", dataJson);
//// if (log.isDebugEnabled()) {
//// log.debug("res: " + res);
//// }
//
// //上传文件
// String res1 = OpenSDK.sendFile("", "open-filegateway",TempBankController.class.getClassLoader().getResource("bank.txt").getPath());
//
// System.out.println(res1);
// //下载文件
//// String res = OpenSDK.sendFileDownload( "productId","fcd47917-bc9c-4c11-b217-f7095f5384fe","D:\\ab\\test");
// }
//
// /**
// * JavaBean方式(通过产品SDK提供的JavaBean)
// *
// * @throws Exception
// */
// public void callByBean() throws Exception {
//
// } // }
//上传文件
String res1 = OpenSDK.sendFile("", "open-filegateway",TempBankController.class.getClassLoader().getResource("bank.txt").getPath());
System.out.println(res1);
//下载文件
// String res = OpenSDK.sendFileDownload( "productId","fcd47917-bc9c-4c11-b217-f7095f5384fe","D:\\ab\\test");
}
/**
* JavaBean方式(通过产品SDK提供的JavaBean)
*
* @throws Exception
*/
public void callByBean() throws Exception {
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论