mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-10-14 19:24:37 +08:00
1.网管支付测试通过
This commit is contained in:
@@ -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\\ncml0eTEXM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UAA4IBAQAujhBuOcuxA+VzoUH84uoFt5aaBM3vGlpW\\r\\nKVMz6BUsLbIpp1ho5h+LaMnxMs6jdXXDh/du8X5SKMaIddiLw7ujZy1LibKy2jYi\\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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
//_____________________________________________________________
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user