提交 8b37a1be authored 作者: aiqingguo's avatar aiqingguo

银行回调

上级 518bfdcc
...@@ -65,16 +65,16 @@ public class TempYftBankController { ...@@ -65,16 +65,16 @@ public class TempYftBankController {
* 订单支付模式 * 订单支付模式
*/ */
public static void bankTest() throws Exception { public static void bankTest() throws Exception {
ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json"); // ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json");
InputStream inputStream = null; // InputStream inputStream = null;
try { // try {
inputStream = classPathResource.getInputStream(); // inputStream = classPathResource.getInputStream();
boolean initResult = NBOpenSDK.init(inputStream); // boolean initResult = NBOpenSDK.init(inputStream);
log.info("NBSDK初始化状态:{}", initResult); // log.info("NBSDK初始化状态:{}", initResult);
log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo()); // log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo());
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
unionPayDirectOrder(); unionPayDirectOrder();
} }
...@@ -281,16 +281,16 @@ public class TempYftBankController { ...@@ -281,16 +281,16 @@ public class TempYftBankController {
* 转账直连下单 * 转账直连下单
*/ */
public static void bankTest1() throws Exception { public static void bankTest1() throws Exception {
ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json"); // ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json");
InputStream inputStream = null; // InputStream inputStream = null;
try { // try {
inputStream = classPathResource.getInputStream(); // inputStream = classPathResource.getInputStream();
boolean initResult = NBOpenSDK.init(inputStream); // boolean initResult = NBOpenSDK.init(inputStream);
log.info("NBSDK初始化状态:{}", initResult); // log.info("NBSDK初始化状态:{}", initResult);
log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo()); // log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo());
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
directBankTransferOrder(); directBankTransferOrder();
} }
......
...@@ -5,11 +5,14 @@ import com.nbopen.api.*; ...@@ -5,11 +5,14 @@ import com.nbopen.api.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -19,6 +22,19 @@ import java.util.Map; ...@@ -19,6 +22,19 @@ import java.util.Map;
@Api(tags = "宁波银行回调") @Api(tags = "宁波银行回调")
public class NbBankController { public class NbBankController {
static {
ClassPathResource classPathResource = new ClassPathResource("bank/config-nbbank.json");
InputStream inputStream = null;
try {
inputStream = classPathResource.getInputStream();
boolean initResult = NBOpenSDK.init(inputStream);
log.info("NBSDK初始化状态:{}", initResult);
log.info("sdk版本信息:{}", NBOpenSDK.getVersionInfo());
} catch (IOException e) {
e.printStackTrace();
}
}
/** /**
* 解密后 * 解密后
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论