mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-09-03 05:24:28 +08:00
2.14.10, 还原jdk8,移除不用字段
This commit is contained in:
@@ -107,7 +107,6 @@ public class AliPayConfigStorage extends BasePayConfigStorage {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return seller;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ import com.egzosn.pay.common.util.str.StringUtils;
|
||||
public class AliPayService extends BasePayService<AliPayConfigStorage> implements TransferService, AliPayServiceInf {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* api服务地址,默认为国内
|
||||
*/
|
||||
|
||||
@@ -27,12 +27,6 @@ public class BaiduPayConfigStorage extends BasePayConfigStorage {
|
||||
return getDealId();
|
||||
}
|
||||
|
||||
//使用json序列化的时候会报错,所以不要直接抛出异常
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return getDealId();
|
||||
}
|
||||
|
||||
public String getDealId() {
|
||||
return dealId;
|
||||
}
|
||||
|
||||
@@ -45,12 +45,6 @@ public interface PayConfigStorage extends Attrs {
|
||||
*/
|
||||
String getPid();
|
||||
|
||||
/**
|
||||
* 获取收款账号
|
||||
*
|
||||
* @return 收款账号
|
||||
*/
|
||||
String getSeller();
|
||||
|
||||
/**
|
||||
* 授权令牌
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
import static com.egzosn.pay.union.bean.UnionTransactionType.WEB;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.egzosn.pay.common.bean.RefundResult;
|
||||
import com.egzosn.pay.demo.request.QueryOrder;
|
||||
import com.egzosn.pay.demo.service.handler.WxV3PayMessageHandler;
|
||||
import com.egzosn.pay.web.support.HttpRequestNoticeParams;
|
||||
import com.egzosn.pay.wx.v3.api.WxPayConfigStorage;
|
||||
import com.egzosn.pay.wx.v3.api.WxPayService;
|
||||
import com.egzosn.pay.wx.v3.bean.WxTransactionType;
|
||||
import com.egzosn.pay.wx.v3.bean.WxTransferType;
|
||||
@@ -52,7 +51,7 @@ public class WxV3PayController {
|
||||
|
||||
|
||||
// @PostConstruct //没有证书的情况下注释掉,避免启动报错
|
||||
public void init() {
|
||||
public void init() throws IOException {
|
||||
com.egzosn.pay.wx.v3.api.WxPayConfigStorage wxPayConfigStorage = new com.egzosn.pay.wx.v3.api.WxPayConfigStorage();
|
||||
wxPayConfigStorage.setAppId("wx5ce9f1a2****");
|
||||
wxPayConfigStorage.setMchId("170330*****");
|
||||
@@ -70,11 +69,11 @@ public class WxV3PayController {
|
||||
wxPayConfigStorage.setInputCharset("utf-8");
|
||||
//使用证书时设置为true
|
||||
// wxPayConfigStorage.setCertSign(true);
|
||||
/使用P12证书方式, 商户API证书 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_1.shtml
|
||||
//使用P12证书方式, 商户API证书 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_1.shtml
|
||||
// wxPayConfigStorage.setApiClientKeyP12("http://pay.egzosn.com/yifenli_mall.p12");
|
||||
// wxPayConfigStorage.setCertStoreType(CertStoreType.URL);
|
||||
//使用pem证书方式
|
||||
wxPayConfigStorage.setKeyPrivate(Files.readString(Paths.get("wechatpay/apiclient_key.pem")));
|
||||
wxPayConfigStorage.setKeyPrivate(new String(Files.readAllBytes(Paths.get("wechatpay/apiclient_key.pem"))));
|
||||
wxPayConfigStorage.setMerchantSerialNumber("2C1230A7BA8C7B197FC90852CCA****");
|
||||
|
||||
com.egzosn.pay.wx.v3.api.WxPayService service = new com.egzosn.pay.wx.v3.api.WxPayService(wxPayConfigStorage);
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.egzosn.pay.demo.service.handler;
|
||||
import com.egzosn.pay.ali.api.AliPayService;
|
||||
import com.egzosn.pay.ali.bean.AliPayMessage;
|
||||
import com.egzosn.pay.common.api.PayMessageHandler;
|
||||
import com.egzosn.pay.common.api.PayService;
|
||||
import com.egzosn.pay.common.bean.PayMessage;
|
||||
import com.egzosn.pay.common.bean.PayOutMessage;
|
||||
import com.egzosn.pay.common.bean.outbuilder.TextBuilder;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@@ -53,9 +53,5 @@ public class FuiouPayConfigStorage extends BasePayConfigStorage {
|
||||
this.mchntCd = mchntCd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PayoneerConfigStorage extends BasePayConfigStorage {
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getAppid() {
|
||||
return null;
|
||||
return programId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ public class PayoneerConfigStorage extends BasePayConfigStorage {
|
||||
*/
|
||||
@Override
|
||||
public String getAppId() {
|
||||
return null;
|
||||
return programId;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,14 +50,11 @@ public class PayoneerConfigStorage extends BasePayConfigStorage {
|
||||
*/
|
||||
@Override
|
||||
public String getPid() {
|
||||
return programId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取商户Id
|
||||
*
|
||||
|
||||
@@ -87,7 +87,7 @@ public class PayoneerPayService extends BasePayService<PayoneerConfigStorage> im
|
||||
private HttpHeader authHeader() {
|
||||
|
||||
List<Header> headers = new ArrayList<>();
|
||||
headers.add(new BasicHeader("Authorization", "Basic " + authorizationString(getPayConfigStorage().getSeller(), getPayConfigStorage().getKeyPrivate())));
|
||||
headers.add(new BasicHeader("Authorization", "Basic " + authorizationString(getPayConfigStorage().getPid(), getPayConfigStorage().getKeyPrivate())));
|
||||
|
||||
return new HttpHeader(headers);
|
||||
}
|
||||
@@ -498,7 +498,7 @@ public class PayoneerPayService extends BasePayService<PayoneerConfigStorage> im
|
||||
*/
|
||||
@Override
|
||||
public String getReqUrl(TransactionType type) {
|
||||
return (payConfigStorage.isTest() ? SANDBOX_DOMAIN : RELEASE_DOMAIN) + payConfigStorage.getPid() + "/" + type.getMethod();
|
||||
return (payConfigStorage.isTest() ? SANDBOX_DOMAIN : RELEASE_DOMAIN) + payConfigStorage.getAppId() + "/" + type.getMethod();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ public class PayPalConfigStorage extends BasePayConfigStorage {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ import com.egzosn.pay.paypal.v2.utils.PayPalUtil;
|
||||
* @author egan
|
||||
* <p>
|
||||
* email egzosn@gmail.com
|
||||
* date 2021-1-16 22:15:09
|
||||
* date 2021-1-16 22:15:09
|
||||
*/
|
||||
public class PayPalPayService extends BasePayService<PayPalConfigStorage> implements PayPalPayServiceInf {
|
||||
|
||||
|
||||
@@ -22,10 +22,6 @@ public class UnionPayConfigStorage extends BasePayConfigStorage {
|
||||
*/
|
||||
private String merId;
|
||||
|
||||
/**
|
||||
* 商户收款账号
|
||||
*/
|
||||
private String seller;
|
||||
|
||||
private String version = "5.1.0";
|
||||
/**
|
||||
@@ -195,14 +191,6 @@ public class UnionPayConfigStorage extends BasePayConfigStorage {
|
||||
this.merId = pid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return seller;
|
||||
}
|
||||
|
||||
public void setSeller(String seller) {
|
||||
this.seller = seller;
|
||||
}
|
||||
|
||||
public String getMerId() {
|
||||
return merId;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class WxYouDianPayConfigStorage extends BasePayConfigStorage {
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
public String seller;
|
||||
public String pid;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -40,16 +40,20 @@ public class WxYouDianPayConfigStorage extends BasePayConfigStorage {
|
||||
|
||||
@Override
|
||||
public String getPid() {
|
||||
return null;
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setSeller(String seller) {
|
||||
this.seller = seller;
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSeller(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
|
||||
public String getSeller() {
|
||||
return seller;
|
||||
return pid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class WxYouDianPayService extends BasePayService<WxYouDianPayConfigStorag
|
||||
*/
|
||||
private JSONObject login() throws PayErrorException {
|
||||
TreeMap<String, String> data = new TreeMap<>();
|
||||
data.put("username", payConfigStorage.getSeller());
|
||||
data.put("username", payConfigStorage.getPid());
|
||||
data.put("password", payConfigStorage.getKeyPrivate());
|
||||
String apbNonce = SignTextUtils.randomStr();
|
||||
// 1、确定请求主体为用户登录,即需要传登录的用户名username和密码password并且要生成唯一的随机数命名为apb_nonce,长度为32位
|
||||
|
||||
@@ -55,12 +55,6 @@ public class WxPayConfigStorage extends BasePayConfigStorage {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getMchId() {
|
||||
return mchId;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
package com.egzosn.pay.wx.v3.api;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.egzosn.pay.common.bean.AssistOrder;
|
||||
import com.egzosn.pay.common.bean.Order;
|
||||
import com.egzosn.pay.common.bean.OrderParaStructure;
|
||||
import com.egzosn.pay.common.bean.PayMessage;
|
||||
import com.egzosn.pay.common.bean.PayOrder;
|
||||
import com.egzosn.pay.common.bean.*;
|
||||
import com.egzosn.pay.common.bean.result.PayException;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import com.egzosn.pay.common.http.HttpConfigStorage;
|
||||
@@ -21,6 +14,9 @@ import com.egzosn.pay.wx.v3.bean.WxTransactionType;
|
||||
import com.egzosn.pay.wx.v3.bean.combine.CombinePayMessage;
|
||||
import com.egzosn.pay.wx.v3.utils.WxConst;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信合单支付服务
|
||||
*
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.egzosn.pay.wx.v3.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.egzosn.pay.common.bean.AssistOrder;
|
||||
import com.egzosn.pay.common.bean.OrderParaStructure;
|
||||
import com.egzosn.pay.common.bean.PayOrder;
|
||||
import com.egzosn.pay.common.util.MapGen;
|
||||
import com.egzosn.pay.wx.v3.utils.WxConst;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信参数构造器
|
||||
*
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.egzosn.pay.wx.v3.api;
|
||||
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.egzosn.pay.common.bean.PayOrder;
|
||||
import com.egzosn.pay.common.bean.TransactionType;
|
||||
import com.egzosn.pay.common.http.ResponseEntity;
|
||||
import org.apache.http.HttpEntity;
|
||||
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信支付辅助服务
|
||||
|
||||
@@ -121,11 +121,6 @@ public class WxPayConfigStorage extends BasePayConfigStorage {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return mchId;
|
||||
}
|
||||
|
||||
|
||||
public String getMchId() {
|
||||
return mchId;
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
package com.egzosn.pay.wx.v3.api;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.message.BasicHeader;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.egzosn.pay.common.bean.AssistOrder;
|
||||
import com.egzosn.pay.common.bean.BillType;
|
||||
import com.egzosn.pay.common.bean.MethodType;
|
||||
import com.egzosn.pay.common.bean.NoticeParams;
|
||||
import com.egzosn.pay.common.bean.OrderParaStructure;
|
||||
import com.egzosn.pay.common.bean.PayMessage;
|
||||
import com.egzosn.pay.common.bean.PayOrder;
|
||||
import com.egzosn.pay.common.bean.RefundOrder;
|
||||
import com.egzosn.pay.common.bean.RefundResult;
|
||||
import com.egzosn.pay.common.bean.TransferOrder;
|
||||
import com.egzosn.pay.common.bean.*;
|
||||
import com.egzosn.pay.common.bean.result.PayException;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import com.egzosn.pay.common.http.HttpConfigStorage;
|
||||
import com.egzosn.pay.common.http.HttpStringEntity;
|
||||
import com.egzosn.pay.common.http.UriVariables;
|
||||
import com.egzosn.pay.common.util.DateUtils;
|
||||
import com.egzosn.pay.common.util.MapGen;
|
||||
@@ -32,6 +16,10 @@ import com.egzosn.pay.wx.v3.bean.sharing.ProfitSharingPayMessage;
|
||||
import com.egzosn.pay.wx.v3.bean.sharing.WxProfitSharingReturnResult;
|
||||
import com.egzosn.pay.wx.v3.utils.WxConst;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信分账API服务
|
||||
*
|
||||
@@ -121,7 +109,6 @@ public class WxProfitSharingService extends WxPayService implements ProfitSharin
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 返回创建的订单信息
|
||||
*
|
||||
|
||||
@@ -35,7 +35,7 @@ public class YiJiPayConfigStorage extends BasePayConfigStorage {
|
||||
|
||||
@Override
|
||||
public String getAppid() {
|
||||
return null;
|
||||
return partnerId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ public class YiJiPayConfigStorage extends BasePayConfigStorage {
|
||||
*/
|
||||
@Override
|
||||
public String getAppId() {
|
||||
return null;
|
||||
return partnerId;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,15 +55,11 @@ public class YiJiPayConfigStorage extends BasePayConfigStorage {
|
||||
*/
|
||||
@Override
|
||||
public String getPid() {
|
||||
return partnerId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSeller() {
|
||||
return sellerUserId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getSellerUserId() {
|
||||
return sellerUserId;
|
||||
}
|
||||
|
||||
@@ -170,8 +170,8 @@ public class YiJiPayService extends BasePayService<YiJiPayConfigStorage> {
|
||||
orderInfo.put("orderNo", order.getOutTradeNo());
|
||||
orderInfo.put("outOrderNo", order.getOutTradeNo());
|
||||
|
||||
if (StringUtils.isNotEmpty(payConfigStorage.getSeller())) {
|
||||
orderInfo.put("sellerUserId", payConfigStorage.getSeller());
|
||||
if (StringUtils.isNotEmpty(payConfigStorage.getSellerUserId())) {
|
||||
orderInfo.put("sellerUserId", payConfigStorage.getSellerUserId());
|
||||
}
|
||||
|
||||
((YiJiTransactionType) order.getTransactionType()).setAttribute(orderInfo, order);
|
||||
@@ -195,7 +195,7 @@ public class YiJiPayService extends BasePayService<YiJiPayConfigStorage> {
|
||||
*/
|
||||
private Map<String, Object> getPublicParameters(TransactionType transactionType) {
|
||||
Map<String, Object> orderInfo = new TreeMap<>();
|
||||
orderInfo.put("partnerId", payConfigStorage.getPid());
|
||||
orderInfo.put("partnerId", payConfigStorage.getPartnerId());
|
||||
orderInfo.put("returnUrl", payConfigStorage.getReturnUrl());
|
||||
orderInfo.put("notifyUrl", payConfigStorage.getNotifyUrl());
|
||||
orderInfo.put("service", transactionType.getMethod());
|
||||
|
||||
8
pom.xml
8
pom.xml
@@ -64,16 +64,16 @@
|
||||
|
||||
|
||||
<properties>
|
||||
<revision>2.14.9</revision>
|
||||
<revision>2.14.10</revision>
|
||||
<httpmime.version>4.5.4</httpmime.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<zxing.version>3.3.1</zxing.version>
|
||||
<servlet-api.version>4.0.1</servlet-api.version>
|
||||
<bcprov-jdk15on.version>1.59</bcprov-jdk15on.version>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<java.version>8</java.version>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<flatten-maven-plugin.version>1.1.0</flatten-maven-plugin.version>
|
||||
|
||||
Reference in New Issue
Block a user