修改了银联支付的代码模块,修改了配置文件
This commit is contained in:
parent
c6e431c93f
commit
fdd54735e5
@ -9,6 +9,8 @@ import com.google.zxing.qrcode.QRCodeWriter;
|
|||||||
import com.xkrs.unionpay.bean.DemoBase;
|
import com.xkrs.unionpay.bean.DemoBase;
|
||||||
import com.xkrs.unionpay.service.UnionpayService;
|
import com.xkrs.unionpay.service.UnionpayService;
|
||||||
import com.xkrs.unionpay.util.AcpService;
|
import com.xkrs.unionpay.util.AcpService;
|
||||||
|
import com.xkrs.unionpay.util.LogUtil;
|
||||||
|
import com.xkrs.unionpay.util.SDKConfig;
|
||||||
import com.xkrs.unionpay.util.SDKConstants;
|
import com.xkrs.unionpay.util.SDKConstants;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -38,6 +40,7 @@ public class UnionpayController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UnionpayService unionpayService;
|
private UnionpayService unionpayService;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/pay")
|
@RequestMapping("/pay")
|
||||||
public void pay(HttpServletResponse response) throws Exception{
|
public void pay(HttpServletResponse response) throws Exception{
|
||||||
String qrCode=unionpayService.pay(DemoBase.getOrderId(),"200");
|
String qrCode=unionpayService.pay(DemoBase.getOrderId(),"200");
|
||||||
@ -83,7 +86,8 @@ public class UnionpayController {
|
|||||||
|
|
||||||
|
|
||||||
Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>();
|
Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>();
|
||||||
hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); // 内容所使用字符集编码
|
// 内容所使用字符集编码
|
||||||
|
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
|
||||||
|
|
||||||
BitMatrix bitMatrix = new MultiFormatWriter().encode(content,
|
BitMatrix bitMatrix = new MultiFormatWriter().encode(content,
|
||||||
BarcodeFormat.QR_CODE, 200, 200, hints);
|
BarcodeFormat.QR_CODE, 200, 200, hints);
|
||||||
@ -100,6 +104,7 @@ public class UnionpayController {
|
|||||||
MatrixToImageWriter.writeToStream(bitMatrix,"png",outputStream);*/
|
MatrixToImageWriter.writeToStream(bitMatrix,"png",outputStream);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/notify")
|
@RequestMapping("/notify")
|
||||||
public void hello2(HttpServletRequest request, HttpServletResponse response) throws Exception{
|
public void hello2(HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||||
Map<String,String> result=new HashMap<>();
|
Map<String,String> result=new HashMap<>();
|
||||||
|
@ -67,12 +67,12 @@ public class UnionpayServiceImpl implements UnionpayService {
|
|||||||
if (AcpService.validate(rspData, DemoBase.encoding)) {
|
if (AcpService.validate(rspData, DemoBase.encoding)) {
|
||||||
LogUtil.writeLog("验证签名成功");
|
LogUtil.writeLog("验证签名成功");
|
||||||
String respCode = rspData.get("respCode");
|
String respCode = rspData.get("respCode");
|
||||||
|
|
||||||
if (("00").equals(respCode)) {
|
if (("00").equals(respCode)) {
|
||||||
System.out.println("受理成功");
|
System.out.println("受理成功");
|
||||||
//TODO
|
//TODO
|
||||||
|
|
||||||
qrCode=rspData.get("qrCode");
|
qrCode=rspData.get("qrCode");
|
||||||
|
System.out.println("---------" + qrCode);
|
||||||
} else {
|
} else {
|
||||||
//其他应答码为失败请排查原因或做失败处理
|
//其他应答码为失败请排查原因或做失败处理
|
||||||
//TODO
|
//TODO
|
||||||
|
@ -144,7 +144,7 @@ acpsdk.ifValidateCNName=false
|
|||||||
acpsdk.ifValidateRemoteCert=false
|
acpsdk.ifValidateRemoteCert=false
|
||||||
|
|
||||||
#后台通知地址,填写接收银联后台通知的地址,必须外网能访问
|
#后台通知地址,填写接收银联后台通知的地址,必须外网能访问
|
||||||
acpsdk.backUrl=http://222.222.222.222:8080/ACPSample_QRC/backRcvResponse
|
acpsdk.backUrl=http://8.136.100.69:6801/ACPSample_QRC/backRcvResponse
|
||||||
|
|
||||||
#前台通知地址,填写处理银联前台通知的地址,必须外网能访问(二维码产品用不到)
|
#前台通知地址,填写处理银联前台通知的地址,必须外网能访问(二维码产品用不到)
|
||||||
acpsdk.frontUrl=http://localhost:8080/ACPSample_QRC/frontRcvResponse
|
acpsdk.frontUrl=http://localhost:8080/ACPSample_QRC/frontRcvResponse
|
||||||
|
Loading…
Reference in New Issue
Block a user