修改了银联支付的代码模块,修改了配置文件
This commit is contained in:
		| @@ -9,6 +9,8 @@ import com.google.zxing.qrcode.QRCodeWriter; | ||||
| import com.xkrs.unionpay.bean.DemoBase; | ||||
| import com.xkrs.unionpay.service.UnionpayService; | ||||
| 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 org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| @@ -38,6 +40,7 @@ public class UnionpayController { | ||||
|     @Resource | ||||
|     private UnionpayService unionpayService; | ||||
|  | ||||
|  | ||||
|     @RequestMapping("/pay") | ||||
|     public void pay(HttpServletResponse response) throws Exception{ | ||||
|         String qrCode=unionpayService.pay(DemoBase.getOrderId(),"200"); | ||||
| @@ -83,7 +86,8 @@ public class UnionpayController { | ||||
|  | ||||
|  | ||||
|         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, | ||||
|                 BarcodeFormat.QR_CODE, 200, 200, hints); | ||||
| @@ -100,6 +104,7 @@ public class UnionpayController { | ||||
|         MatrixToImageWriter.writeToStream(bitMatrix,"png",outputStream);*/ | ||||
|     } | ||||
|  | ||||
|  | ||||
|     @RequestMapping("/notify") | ||||
|     public void hello2(HttpServletRequest request, HttpServletResponse response) throws Exception{ | ||||
|         Map<String,String> result=new HashMap<>(); | ||||
|   | ||||
| @@ -67,12 +67,12 @@ public class UnionpayServiceImpl implements UnionpayService { | ||||
|             if (AcpService.validate(rspData, DemoBase.encoding)) { | ||||
|                 LogUtil.writeLog("验证签名成功"); | ||||
|                 String respCode = rspData.get("respCode"); | ||||
|  | ||||
|                 if (("00").equals(respCode)) { | ||||
|                     System.out.println("受理成功"); | ||||
|                     //TODO | ||||
|  | ||||
|                     qrCode=rspData.get("qrCode"); | ||||
|                     System.out.println("---------" + qrCode); | ||||
|                 } else { | ||||
|                     //其他应答码为失败请排查原因或做失败处理 | ||||
|                     //TODO | ||||
|   | ||||
| @@ -144,7 +144,7 @@ acpsdk.ifValidateCNName=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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user