Merge remote-tracking branch 'origin/master'

This commit is contained in:
egan
2019-03-22 10:37:53 +08:00
14 changed files with 40 additions and 17 deletions

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pay-java-ali</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

View File

@@ -55,6 +55,11 @@ public class TransferOrder {
*/
private TransferType transferType;
/**
* 操作者ip根据支付平台所需进行设置
*/
private String ip;
public String getOutNo() {
return outNo;
}
@@ -126,4 +131,12 @@ public class TransferOrder {
public void setTransferType(TransferType transferType) {
this.transferType = transferType;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
}

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pay-java-fuiou</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pay-java-payoneer</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -264,7 +264,7 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
public Map<String, Object> refund(RefundOrder refundOrder) {
JSONObject request = new JSONObject();
if (null != refundOrder.getRefundAmount() && BigDecimal.ZERO.compareTo( refundOrder.getRefundAmount()) > 0){
if (null != refundOrder.getRefundAmount() && BigDecimal.ZERO.compareTo( refundOrder.getRefundAmount()) == -1){
Amount amount = new Amount();
amount.setCurrency(refundOrder.getCurType().name());
amount.setTotal(Util.conversionAmount(refundOrder.getRefundAmount()).toString());
@@ -272,7 +272,7 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
request.put("description", refundOrder.getDescription());
}
HttpStringEntity httpEntity = new HttpStringEntity(request, ContentType.APPLICATION_JSON);
HttpStringEntity httpEntity = new HttpStringEntity(request.toJSONString(), ContentType.APPLICATION_JSON);
httpEntity.setHeaders(authHeader());
JSONObject resp = getHttpRequestTemplate().postForObject(getReqUrl(PayPalTransactionType.REFUND), httpEntity, JSONObject.class, refundOrder.getTradeNo());
return resp;
@@ -310,4 +310,6 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
public Map<String, Object> secondaryInterface(Object tradeNoOrBillDate, String outTradeNoBillType, TransactionType transactionType) {
return Collections.emptyMap();
}
}

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pay-java-wx-youdian</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>pay-java-parent</artifactId>
<groupId>com.egzosn</groupId>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pay-java-wx</artifactId>

View File

@@ -604,7 +604,7 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> {
public Map<String, Object> transfer(TransferOrder order) {
Map<String, Object> parameters = new TreeMap<String, Object>();
parameters.put("mch_id", payConfigStorage.getPid());
parameters.put("partner_trade_no", order.getOutNo());
parameters.put("amount", Util.conversionCentAmount(order.getAmount()));
if (!StringUtils.isEmpty(order.getRemark())){
@@ -613,7 +613,9 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> {
parameters.put("nonce_str", SignUtils.randomStr());
if (null != order.getTransferType() && TRANSFERS == order.getTransferType()){
transfers(parameters, order);
parameters.put("mchid", payConfigStorage.getPid());
}else {
parameters.put("mch_id", payConfigStorage.getPid());
order.setTransferType(WxTransferType.PAY_BANK);
payBank(parameters, order);
}
@@ -636,6 +638,7 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> {
//转账到余额, 申请商户号的appid或商户号绑定的appid
parameters.put("mch_appid", payConfigStorage.getAppid());
parameters.put("openid", order.getPayeeAccount());
parameters.put("spbill_create_ip", StringUtils.isEmpty(order.getIp()) ? "192.168.1.150" : order.getIp());
//默认不校验真实姓名
parameters.put("check_name", "NO_CHECK");
//当存在时候 校验收款用户真实姓名

View File

@@ -23,10 +23,15 @@ public class PayTest {
public static void main(String[] args) {
WxPayConfigStorage wxPayConfigStorage = new WxPayConfigStorage();
wxPayConfigStorage.setAppid("公众账号ID");
wxPayConfigStorage.setMchId("合作者id商户号");
wxPayConfigStorage.setAppid("应用id");
wxPayConfigStorage.setKeyPublic("密钥");
wxPayConfigStorage.setKeyPrivate("密钥");
//以下两个参数在 服务商版模式中必填--------
// wxPayConfigStorage.setSubAppid("子商户公众账号ID ");
// wxPayConfigStorage.setSubMchId("微信支付分配的子商户号 ");
//-----------------------------------------------
wxPayConfigStorage.setKeyPublic("转账公钥,转账时必填");
wxPayConfigStorage.setSecretKey("密钥");
wxPayConfigStorage.setNotifyUrl("异步回调地址");
wxPayConfigStorage.setReturnUrl("同步回调地址");
wxPayConfigStorage.setSignType("签名方式");

View File

@@ -7,7 +7,7 @@
<groupId>com.egzosn</groupId>
<artifactId>pay-java-parent</artifactId>
<packaging>pom</packaging>
<version>2.12.6</version>
<version>2.12.7-SNAPSHOT</version>
<name>Pay Java - Parent</name>
<description>Pay Java Parent</description>
@@ -56,7 +56,7 @@
<properties>
<pay.version>2.12.6</pay.version>
<pay.version>2.12.7-SNAPSHOT</pay.version>
<httpmime.version>4.5.4</httpmime.version>
<log4j.version>1.2.17</log4j.version>
<fastjson.version>1.2.41</fastjson.version>