Merge branch 'update' into develop

master
wangning 7 years ago
commit 3b593ec9fb

@ -37,7 +37,7 @@
## 支付宝渠道区分
支付宝根据调用接口不同分为线上和线下两个渠道,两个渠道分别使用不同的汇率和手续费费率,为避免混淆在此区分:
+ 线上渠道包含H5 Mobile、Web支付以及APP SDK(未上线)三种支付方式
+ 线上渠道包含H5 Mobile、Web支付以及APP SDK三种支付方式
+ 线下渠道包含JSAPI、QR Code、Retail Pay 3种支付方式
相似接口区别

@ -37,7 +37,7 @@ System error message supports Simplified Chinese and English. The system by defa
## Alipay Channels
According to different Api used, Alipay channel was distributed to Retail channel and Online channel. Two channels has different exchange rate and surcharge rate.
+ Online Channel: Including H5 Mobile, Online Payment and APP SDK(coming soon)
+ Online Channel: Including H5 Mobile, Online Payment and APP SDK
+ Retail Channel: Including JSAPI, QR Code Api, Retail Pay
Difference

@ -0,0 +1,45 @@
package au.com.royalpay.payment.manage.support.wechatclients;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WechatRedpack;
import au.com.royalpay.payment.tools.connections.mpsupport.impls.AbstractMpWechatClientApi;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* Created by yishuqian on 11/01/2017.
*/
@Service
public class NAPWechatApi extends AbstractMpWechatClientApi implements MpWechatApi {
@PostConstruct
public void initTemplates() {
}
@Override
public String targetMpAccount() {
return "globalpay";
}
@Override
public String getOpenIdKey() {
return "globalpay_openid";
}
@Override
public JSONObject sendRedpack(WechatRedpack redpackInfo) {
throw new ServerErrorException("Cannot send redpack with this merchant");
}
@Override
public JSONObject redpackStatus(String redpackId) {
throw new ServerErrorException("Cannot send redpack with this merchant");
}
@Override
public boolean matchOpenId(String openId) {
return openId.startsWith("olHWD");
}
}

@ -21,7 +21,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
@ -171,7 +173,22 @@ public class ClientContractServiceImpl implements ClientContractService {
return result;
}
int waringDays = sysConfigManager.getSysConfig().getIntValue("rate_warning_days");
for (JSONObject p : rateInfo) {
Map<String,JSONObject> filterMap = new HashMap<>();
rateInfo.forEach((p)->{
String key = p.getString("rate_name");
JSONObject tmp = filterMap.get(key);
if(tmp==null){
filterMap.put(key,p);
}else {
if(tmp.getDate("expiry_time").compareTo(p.getDate("expiry_time"))<0){
filterMap.put(key,p);
}
}
});
for (JSONObject p : filterMap.values()) {
if (now.compareTo(DateUtils.addDays(p.getDate("expiry_time"),1)) > -1) {
result.put("rate_expire", true);
}

@ -11,3 +11,10 @@ app.wechatpay.merchants.1431999902.merchant-id=1431999902
app.wechatpay.merchants.1431999902.mch-key=p3tgzrAJbe6eQrunbv8jb8gz5yXxvJdE
app.wechatpay.merchants.1431999902.key-file=classpath:apiclient_new_cert.p12
app.wechatpay.merchants.1431999902.example-sub-merchant-id=42991963
app.wechatpay.merchants.1487387142.app-id=wx3e14d1144d898197
app.wechatpay.merchants.1487387142.mp-id=globalpay
app.wechatpay.merchants.1487387142.merchant-id=1487387142
app.wechatpay.merchants.1487387142.mch-key=OuvLIL93STqFhTngNaBGT8751ZJn4FKL
app.wechatpay.merchants.1487387142.key-file=classpath:napclient_cert.p12
app.wechatpay.merchants.1487387142.example-sub-merchant-id=117551742
Loading…
Cancel
Save