Merge remote-tracking branch 'origin/master'

This commit is contained in:
egzosn
2018-01-09 14:20:28 +08:00
43 changed files with 56 additions and 111 deletions

View File

@@ -49,25 +49,27 @@
</dependency>
```
#### 本项目在以下代码托管网站
* 码云https://gitee.com/egzosn/pay-java-parent
* GitHubhttps://github.com/egzosn/pay-java-parent
### 使用
这里不多说直接上代码 集群的话,友店可能会有bug。
这里不多说直接上代码
测试链接 http://pay.egzosn.com/index.html
###### 单一支付教程
[基础模块支付宝微信讲解](https://gitee.com/egzosn/pay-java-parent/wikis/Home)
[友店微信](pay-java-wx-youdian?dir=1&filepath=pay-java-youdian)
[富友](pay-java-fuiou?dir=1&filepath=pay-java-fuiou)
[银联](pay-java-union?dir=1&filepath=pay-java-union)
* [基础模块支付宝微信讲解](https://gitee.com/egzosn/pay-java-parent/wikis/Home)
* [友店微信](pay-java-wx-youdian?dir=1&filepath=pay-java-youdian)
* [富友](pay-java-fuiou?dir=1&filepath=pay-java-fuiou)
* [银联](pay-java-union?dir=1&filepath=pay-java-union)
支付整合》服务端+网页端详细使用与简单教程请看 [pay-java-demo](pay-java-demo?dir=1&filepath=pay-java-demo)
android 例子 [pay-java-android](http://git.oschina.net/egzosn/pay-java-android)
android 例子 [pay-java-android](https://gitee.com/egzosn/pay-java-android)
## 交流

View File

@@ -2,7 +2,6 @@
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;
@@ -310,8 +309,8 @@ 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 = JSONObject.parseObject("{\"bizType\":\"000201\",\"signPubKeyCert\":\"-----BEGIN CERTIFICATE-----\\r\\nMIIEQzCCAyugAwIBAgIFEBJJZVgwDQYJKoZI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DAdBgNVHQ4EFgQU\\r\\nmQQLyuqYjES7qKO+zOkzEbvdFwgwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUF\\r\\nBwMEMA0GCSqGSIb3DQEBBQUAA4IBAQAujhBuOcuxA+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\"}");
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\\nMjAxMTAxMDcyNDA4WjB3MQswCQYDVQQGEwJjbjESMBAGA1UEChMJQ0ZDQSBPQ0Ex\\r\\nMQ4wDAYDVQQLEwVDVVBSQTEUMBIGA1UECxMLRW50ZXJwcmlzZXMxLjAsBgNVBAMU\\r\\nJTA0MUBaMjAxNy0xMS0xQDAwMDQwMDAwOlNJR05AMDAwMDAwMDEwggEiMA0GCSqG\\r\\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDIWO6AESrg+34HgbU9mSpgef0sl6avr1d\\r\\nbD/IjjZYM63SoQi3CZHZUyoyzBKodRzowJrwXmd+hCmdcIfavdvfwi6x+ptJNp9d\\r\\nEtpfEAnJk+4quriQFj1dNiv6uP8ARgn07UMhgdYB7D8aA1j77Yk1ROx7+LFeo7rZ\\r\\nDdde2U1opPxjIqOPqiPno78JMXpFn7LiGPXu75bwY2rYIGEEImnypgiYuW1vo9UO\\r\\nG47NMWTnsIdy68FquPSw5FKp5foL825GNX3oJSZui8d2UDkMLBasf06Jz0JKz5AV\\r\\nblaI+s24/iCfo8r+6WaCs8e6BDkaijJkR/bvRCQeQpbX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2nmQlhRRnLtHq1ri7v1QPlu2FzM+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,14 +83,14 @@ public class ApyAccountRepository {
ApyAccount apyAccount4 = new ApyAccount();
apyAccount4.setPayId(4);
apyAccount4.setPartner("777290058110048");
apyAccount4.setPartner("700000000000001");
//公钥,验签证书链格式: 中级证书路径;根证书路径
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");
apyAccount4.setNotifyUrl("http://127.0.0.1/payBack4.json");
// 无需同步回调可不填 app填这个就可以
apyAccount4.setReturnUrl("http://b1234780541.eicp.net/payBack4.json");
apyAccount4.setReturnUrl("http://127.0.0.1/payBack4.json");
apyAccount4.setSeller("");
apyAccount4.setInputCharset("UTF-8");
apyAccount4.setSignType(SignUtils.RSA2.name());

View File

@@ -111,7 +111,7 @@ public class PayResponse {
.handler(autowire(new FuiouPayMessageHandler(payId)))
.end()
.rule()
.msgType(MsgType.text.name())
.msgType(MsgType.json.name())
.payType(PayType.unionPay.name())
.handler(autowire(new UnionPayMessageHandler(payId)))
.end()

View File

@@ -1,83 +0,0 @@
<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

@@ -1,2 +0,0 @@
<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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,6 +1,6 @@
## 微信支付简单例子
## 银联支付简单例子
#### 支付配置
@@ -49,6 +49,8 @@
```java
UnionPayService service = new UnionPayService(unionPayConfigStorage);
unionPayConfigStorage.setCertSign(true);//是否为证书签名
```
@@ -57,6 +59,19 @@
```java
PayOrder payOrder = new PayOrder("订单title", "摘要", new BigDecimal(0.01) , new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()));
```
#### 网页支付
```java
// 手机网页支付WAP支付
payOrder.setTransactionType(UnionTransactionType.WAP);
// 网关支付
// payOrder.setTransactionType(UnionTransactionType.WEB);
// 企业网银支付B2B支付
// payOrder.setTransactionType(UnionTransactionType.B2B);
//获取支付所需的信息
Map directOrderInfo = service.orderInfo(payOrder);
//获取表单提交对应的字符串,将其序列化到页面即可,
String directHtml = service.buildRequest(directOrderInfo, MethodType.POST);
```
#### 主扫申请二维码交易
@@ -99,7 +114,7 @@
#### 文件传输类接口:后台获取对账文件交易,只有同步应答
```java
String fileConten = service.downloadbill(new Date(),"格式MMDD");
String fileConten = service.downloadbill("清算日期格式MMDD","文件类型一般商户填写00即可");
```

View File

@@ -616,9 +616,11 @@ public class UnionPayService extends BasePayService {
public <T> T downloadbill (Date billDate, String billType, Callback<T> callback) {
Map<String ,Object > params = this.getCommonParam();
UnionTransactionType.FILE_TRANSFER.convertMap(params);
DateFormat df = new SimpleDateFormat("MMDD");
params.put(SDKConstants.param_settleDate,df.format(new Date()));
DateFormat df = new SimpleDateFormat("MMdd");
params.put(SDKConstants.param_settleDate,df.format(billDate));
params.put(SDKConstants.param_fileType,billType);
params.remove(SDKConstants.param_backUrl);
params.remove(SDKConstants.param_currencyCode);
this.setSign(params);
String responseStr = getHttpRequestTemplate().postForObject(this.getFileTransUrl(),params,String.class);
JSONObject response = UriVariables.getParametersToMap(responseStr);

View File

@@ -1,6 +1,7 @@
package com.egzosn.pay.union.bean;
import com.egzosn.pay.common.bean.TransactionType;
import com.egzosn.pay.common.util.str.StringUtils;
import java.util.Map;
@@ -52,7 +53,7 @@ public enum UnionTransactionType implements TransactionType{
//查询
QUERY("00","00","000201",""),
//对账文件下载
FILE_TRANSFER("00","00","000201","")
FILE_TRANSFER("76","01","000000","")
;
/**
@@ -90,7 +91,9 @@ public enum UnionTransactionType implements TransactionType{
//业务类型
contentData.put(SDKConstants.param_bizType,this.getBizType());
//渠道类型
contentData.put(SDKConstants.param_channelType,this.getChannelType());
if(StringUtils.isNotBlank(this.getChannelType())){
contentData.put(SDKConstants.param_channelType,this.getChannelType());
}
}

View File

@@ -21,9 +21,14 @@ public class PayTest {
UnionPayConfigStorage unionPayConfigStorage = new UnionPayConfigStorage();
//是否为证书签名
unionPayConfigStorage.setCertSign(true);
//商户id
unionPayConfigStorage.setMerId("商户id");
unionPayConfigStorage.setKeyPublic("公钥,验签证书链格式: 中级证书路径;根证书路径");
unionPayConfigStorage.setKeyPrivate("私钥, 私钥证书格式: 私钥证书路径;私钥证书对应的密码");
//公钥,验签证书链格式: 中级证书路径;根证书路径
unionPayConfigStorage.setKeyPublic("D:/certs/acp_test_middle.cer;D:/certs/acp_test_root.cer");
//私钥, 私钥证书格式: 私钥证书路径;私钥证书对应的密码
unionPayConfigStorage.setKeyPrivate("D:/certs/acp_test_sign.pfx;000000");
unionPayConfigStorage.setNotifyUrl("异步回调地址");
unionPayConfigStorage.setReturnUrl("同步回调地址");
unionPayConfigStorage.setSignType("RSA2");
@@ -36,8 +41,13 @@ public class PayTest {
PayOrder payOrder = new PayOrder("订单title", "摘要", new BigDecimal(0.01) , new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()));
/*----------- 网支付-------------------*/
/*----------- 网支付-------------------*/
// 手机网页支付WAP支付
// payOrder.setTransactionType(UnionTransactionType.WAP);
// 网关支付
payOrder.setTransactionType(UnionTransactionType.WEB);
// 企业网银支付B2B支付
// payOrder.setTransactionType(UnionTransactionType.B2B);
//获取支付所需的信息
Map directOrderInfo = service.orderInfo(payOrder);
//获取表单提交对应的字符串,将其序列化到页面即可,
@@ -74,8 +84,7 @@ public class PayTest {
/*-----------文件传输类接口:后台获取对账文件交易,只有同步应答 ------------------------------*/
String fileConten = service.downloadbill(new Date(),"格式为MMDD");
/*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/
String fileConten = service.downloadbill(new Date(),"文件类型一般商户填写00即可"); /*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/
/*-----------回调处理-------------------*/