1.网管支付测试通过

This commit is contained in:
Actinia-517
2017-12-15 22:43:12 +08:00
parent c9296100fa
commit 76f36d07c2
11 changed files with 287 additions and 60 deletions

View File

@@ -2,6 +2,7 @@
package com.egzosn.pay.demo.controller;
import com.alibaba.fastjson.JSONObject;
import com.egzosn.pay.ali.bean.AliTransactionType;
import com.egzosn.pay.common.api.Callback;
import com.egzosn.pay.common.api.PayConfigStorage;
@@ -82,7 +83,7 @@ public class PayController {
//获取对应的支付账户操作工具可根据账户id
PayResponse payResponse = service.getPayResponse(payId);
PayOrder order = new PayOrder("订单title", "摘要", null == price ? new BigDecimal(0.01) : price, UUID.randomUUID().toString().replace("-", ""), PayType.valueOf(payResponse.getStorage().getPayType()).getTransactionType(transactionType));
PayOrder order = new PayOrder("订单title", "摘要", null == price ? new BigDecimal(0.01) : price, "22222222233", PayType.valueOf(payResponse.getStorage().getPayType()).getTransactionType(transactionType));
// ------ 微信H5使用----
order.setSpbillCreateIp(request.getHeader("X-Real-IP"));
StringBuffer requestURL = request.getRequestURL();
@@ -309,7 +310,9 @@ public class PayController {
PayResponse payResponse = service.getPayResponse(payId);
PayConfigStorage storage = payResponse.getStorage();
//获取支付方返回的对应参数
Map<String, Object> params = payResponse.getService().getParameter2Map(request.getParameterMap(), request.getInputStream());
// Map<String, Object> params = payResponse.getService().getParameter2Map(request.getParameterMap(), request.getInputStream());
Map<String, Object> params = JSONObject.parseObject("{\"bizType\":\"000201\",\"signPubKeyCert\":\"-----BEGIN CERTIFICATE-----\\r\\nMIIEQzCCAyugAwIBAgIFEBJJZVgwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UEBhMC\\r\\nQ04xMDAuBgNVBAoTJ0NoaW5hIEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhv\\r\\ncml0eTEXMBUGA1UEAxMOQ0ZDQSBURVNUIE9DQTEwHhcNMTcxMTAxMDcyNDA4WhcN\\r\\nMjAxMTAxMDcyNDA4WjB3MQswCQYDVQQGEwJjbj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LibKy2jYi\\r\\nYYfs3tbZ0ffCKQtv78vCgC+IxUUurALY4w58fRLLdu8u8p9jyRFHsQEwSq+W5+bP\\r\\nMTh2w7cDd9h+6KoCN6AMI1Ly7MxRIhCbNBL9bzaxF9B5GK86ARY7ixkuDCEl4XCF\\r\\nJGxeoye9R46NqZ6AA/k97mJun//gmUjStmb9PUXA59fR5suAB5o/5lBySZ8UXkrI\\r\\npp/iLT8vIl1hNgLh0Ghs7DBSx99I+S3VuUzjHNxL6fGRhlix7Rb8\\r\\n-----END CERTIFICATE-----\",\"orderId\":\"20171213224128\",\"signature\":\"l8xBYSoMNzt01DDa9/JYcrQKWxN5tasUgSxf6NNsQK5t+DqMr2G9qhHXnDg5bEzeRyTFP4bM3htX9RTRhXYDy7EEsL46ZD4ib5I6mp2wXx+26zscUcLdJUiddkY5eFvQK4tPC8blw7Y6p858yiVJpHgbOK3cONhS7vwPJtK2jMbkY+GATu3aZ4iygkQc75cG+EW8nJQVwLNh7q9A6A6II18EFxR7XubdlIHXv/InVaS6ux8Wh2nmQlhRRnLtHq1ri7v1QPlu2FzM+kaf7/fn61iGr8zEPj62NzWDXue62LUfb4kTRgdkcJnfJBJl8vjZ/w93UtsnK3zjzJC/Nu+wCw==\",\"txnSubType\":\"01\",\"traceNo\":\"492156\",\"accNo\":\"6221********0000\",\"settleAmt\":\"1000\",\"settleCurrencyCode\":\"156\",\"settleDate\":\"1213\",\"txnType\":\"01\",\"encoding\":\"UTF-8\",\"version\":\"5.1.0\",\"queryId\":\"511712132241284921568\",\"accessType\":\"0\",\"exchangeRate\":\"0\",\"respMsg\":\"success\",\"traceTime\":\"1213224128\",\"txnTime\":\"20171213224128\",\"merId\":\"777290058154626\",\"currencyCode\":\"156\",\"respCode\":\"00\",\"signMethod\":\"01\",\"txnAmt\":\"1000\"}");
if (null == params) {
return payResponse.getService().getPayOutMessage("fail", "失败").toMessage();
}

View File

@@ -83,19 +83,20 @@ public class ApyAccountRepository {
ApyAccount apyAccount4 = new ApyAccount();
apyAccount4.setPayId(4);
apyAccount4.setPartner("777290058110097");
apyAccount4.setPartner("777290058154626");
// apyAccount4.setAppid("777290058110097");
apyAccount4.setPublicKey("");
apyAccount4.setPrivateKey("000000");
apyAccount4.setNotifyUrl("http://sailinmu.iok.la:19088/backRcvResponse");
apyAccount4.setPublicKey("D:\\certs\\acp_test_middle.cer;D:\\certs\\acp_test_root.cer");
apyAccount4.setPrivateKey("D:\\certs\\acp_test_sign.pfx;000000");
apyAccount4.setNotifyUrl("http://b1234780541.eicp.net/payBack4.json");
// 无需同步回调可不填 app填这个就可以
apyAccount4.setReturnUrl("http://sailinmu.iok.la:19088/backRcvResponse");
apyAccount4.setReturnUrl("http://b1234780541.eicp.net/payBack4.json");
apyAccount4.setSeller("");
apyAccount4.setInputCharset("UTF-8");
apyAccount4.setSignType(SignUtils.RSA.name());
apyAccount4.setSignType(SignUtils.RSA2.name());
apyAccount4.setPayType(PayType.unionPay);
apyAccount4.setMsgType(MsgType.json);
apyAccounts.put(apyAccount4.getPayId(), apyAccount3);
apyAccount4.setTest(true);
apyAccounts.put(apyAccount4.getPayId(), apyAccount4);
}
//_____________________________________________________________

View File

@@ -150,6 +150,8 @@ public enum PayType implements BasePayType {
@Override
public PayService getPayService(ApyAccount apyAccount) {
UnionPayConfigStorage unionPayConfigStorage = new UnionPayConfigStorage();
unionPayConfigStorage.setMerId(apyAccount.getPartner());
unionPayConfigStorage.setCertSign(true);
unionPayConfigStorage.setKeyPublic(apyAccount.getPublicKey());
unionPayConfigStorage.setKeyPrivate(apyAccount.getPrivateKey());
unionPayConfigStorage.setNotifyUrl(apyAccount.getNotifyUrl());

View File

@@ -44,7 +44,7 @@ public class ApyAccountService {
*/
public PayResponse getPayResponse(Integer id) {
PayResponse payResponse = payResponses.get(id);
PayResponse payResponse = null;
if (payResponse == null) {
ApyAccount apyAccount = dao.findByPayId(id);
if (apyAccount == null) {

View File

@@ -0,0 +1,83 @@
<input type="hidden" name="bizType" id="bizType" value="000201"/>
<input type="hidden" name="txnSubType" id="txnSubType" value="01"/>
<input type="hidden" name="orderId" id="orderId" value="20171212232030"/>
<input type="hidden" name="backUrl" id="backUrl" value="http://222.222.222.222:8080/ACPSample_B2C/backRcvResponse"/>
<input type="hidden" name="signature" id="signature" value="FKkJ04TFKLLaZOqfLpRED6zUifJy5csUGLxt966+td9yz8F9HUpS2F763nB5WgiS5Unt8740tIpQtomad19njYH+MdtxNn5dphxcxWMBKxqZenQRV/4fDa4kxsOE63vvyTqtoKH7MPYvZ3ZQ43ZF4PNdVQ0Ksnnv1wMvEuneu8c="/>
<input type="hidden" name="txnType" id="txnType" value="01"/>
<input type="hidden" name="channelType" id="channelType" value="07"/>
<input type="hidden" name="frontUrl" id="frontUrl" value="http://localhost:8080/ACPSample_B2C/frontRcvResponse"/>
<input type="hidden" name="certId" id="certId" value="40220995861346480087409489142384722381"/>
<input type="hidden" name="encoding" id="encoding" value="UTF-8"/>
<input type="hidden" name="version" id="version" value="5.1.0"/>
<input type="hidden" name="accessType" id="accessType" value="0"/>
<input type="hidden" name="txnTime" id="txnTime" value="20171212232030"/>
<input type="hidden" name="merId" id="merId" value="700000000000001"/>
<input type="hidden" name="payTimeout" id="payTimeout" value="20171212233540"/>
<input type="hidden" name="currencyCode" id="currencyCode" value="156"/>
<input type="hidden" name="signMethod" id="signMethod" value="01"/>
<input type="hidden" name="txnAmt" id="txnAmt" value="1000"/>
<input type="hidden" name="bizType" id="bizType" value="000201"/>
<input type="hidden" name="orderId" id="orderId" value="20171212232030"/>
<input type="hidden" name="txnSubType" id="txnSubType" value="01"/>
<input type="hidden" name="backUrl" id="backUrl" value="http://222.222.222.222:8080/ACPSample_B2C/backRcvResponse"/>
<input type="hidden" name="signature" id="signature" value="G7TyB1z07jZYr8QuX9EV5c1m7Ub5aR1fECePE5MQ2GT4iuCHtrJJxFiypYGvMevqOBFl0cG11iEctPJJ8Lbi7JVMUpxENIrZVWcINFrk5uv9n1PIsKTqefEdTARpaJzUD3eb32fr3axBU5qDVk1rRTrmjagzD67q8AP4vgtjih4="/>
<input type="hidden" name="txnType" id="txnType" value="01"/>
<input type="hidden" name="channelType" id="channelType" value="07"/>
<input type="hidden" name="frontUrl" id="frontUrl" value="http://localhost:8080/ACPSample_B2C/frontRcvResponse"/>
<input type="hidden" name="certId" id="certId" value="40220995861346480087409489142384722381"/>
<input type="hidden" name="encoding" id="encoding" value="UTF-8"/>
<input type="hidden" name="version" id="version" value="5.1.0"/>
<input type="hidden" name="accessType" id="accessType" value="0"/>
<input type="hidden" name="merId" id="merId" value="700000000000001"/>
<input type="hidden" name="txnTime" id="txnTime" value="20171212232030"/>
<input type="hidden" name="payTimeout" id="payTimeout" value="20171212233540"/>
<input type="hidden" name="currencyCode" id="currencyCode" value="156"/>
<input type="hidden" name="signMethod" id="signMethod" value="01"/>
<input type="hidden" name="txnAmt" id="txnAmt" value="100000"/>
</form></body><script type="text/javascript">document.all.pay_form.submit();</script></html>
<input type="hidden" name="accessType" id="accessType" value="0"/>
<input type="hidden" name="backUrl" id="backUrl" value="http://222.222.222.222:8080/ACPSample_B2C/backRcvResponse"/>
<input type="hidden" name="bizType" id="bizType" value="000201"/>
<input type="hidden" name="certId" id="certId" value="40220995861346480087409489142384722381"/>
<input type="hidden" name="channelType" id="channelType" value="07"/>
<input type="hidden" name="currencyCode" id="currencyCode" value="156"/>
<input type="hidden" name="encoding" id="encoding" value="UTF-8"/>
<input type="hidden" name="frontUrl" id="frontUrl" value="http://localhost:8080/ACPSample_B2C/frontRcvResponse"/>
<input type="hidden" name="merId" id="merId" value="700000000000001"/>
<input type="hidden" name="orderId" id="orderId" value="20171212232030"/>
<input type="hidden" name="payTimeout" id="payTimeout" value="20171212233540"/>
<input type="hidden" name="signMethod" id="signMethod" value="01"/>
<input type="hidden" name="signature" id="signature" value="WDBPtNuGF9Te4dFG7Yu29LSusvNLHqEYmvCaW69iAxbMlqjnKf0yZ+GXm1MgJ2W7am89UnrCbFYKurE40fw404DqGy/Dx4ML4/xc0V+kP68nwbS9JUMLv0YD2NzgrlZwByRHsfmxyU907mwIcGmQ/lYPiy+wDFrUOU7MdJZIstg="/>
<input type="hidden" name="txnAmt" id="txnAmt" value="1000"/>
<input type="hidden" name="txnSubType" id="txnSubType" value="01"/>
<input type="hidden" name="txnTime" id="txnTime" value="20171212232030"/>
<input type="hidden" name="txnType" id="txnType" value="01"/>
<input type="hidden" name="version" id="version" value="5.1.0"/></form></body><script type="text/javascript">document.all.pay_form.submit();</script></html>
<!--<input type="hidden" name="accessType" id="accessType" value="0"/>
<input type="hidden" name="backUrl" id="backUrl" value="http://222.222.222.222:8080/ACPSample_B2C/backRcvResponse"/>
<input type="hidden" name="bizType" id="bizType" value="000201"/>
<input type="hidden" name="certId" id="certId" value="40220995861346480087409489142384722381"/>
<input type="hidden" name="channelType" id="channelType" value="07"/>
<input type="hidden" name="currencyCode" id="currencyCode" value="156"/>
<input type="hidden" name="encoding" id="encoding" value="UTF-8"/>
<input type="hidden" name="frontUrl" id="frontUrl" value="http://localhost:8080/ACPSample_B2C/frontRcvResponse"/>
<input type="hidden" name="merId" id="merId" value="700000000000001"/>
<input type="hidden" name="orderDesc" id="orderDesc" value="订单title"/>
<input type="hidden" name="orderId" id="orderId" value="31bf4774c7654b689e0280e6db83a8be"/>
<input type="hidden" name="payTimeout" id="payTimeout" value="20171212233540"/>
<input type="hidden" name="signMethod" id="signMethod" value="01"/>
<input type="hidden" name="signature" id="signature" value="GXlNRjti/PTZXrFEgcxWZacYwUjmrRJQacpRnvYfXexofXTBrTdIF4d5uKedG9u4Sms0JB3QwcJcqnBlPbVpbkyykAIXbjhi2iEexE5mU8xiuLMNVx65ZECwMWygLc2ULffXNC9pLRZW5cV5g5zUVcsvEt+FIgFJjXX3LOC1duk="/>
<input type="hidden" name="txnAmt" id="txnAmt" value="100000"/>
<input type="hidden" name="txnSubType" id="txnSubType" value="01"/>
<input type="hidden" name="txnTime" id="txnTime" value="20171212232030"/>
<input type="hidden" name="txnType" id="txnType" value="01"/>
<input type="hidden" name="version" id="version" value="5.1.0"/>-->

View File

@@ -0,0 +1,2 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body><form id = "pay_form" action="https://gateway.test.95516.com/gateway/api/frontTransReq.do" method="post"></form></body><script type="text/javascript">document.all.pay_form.submit();</script></html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body><form id = "pay_form" action="https://gateway.test.95516.com/gateway/api/frontTransReq.do" method="post"></form></body><script type="text/javascript">document.all.pay_form.submit();</script></html>