加入自定义属性

This commit is contained in:
egzosn
2020-11-12 23:33:25 +08:00
parent d6b6819324
commit def4e71a18
3 changed files with 53 additions and 26 deletions

View File

@@ -132,20 +132,13 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
@Override
public boolean verify(Map<String, Object> params) {
if (!(SUCCESS.equals(params.get(RETURN_CODE)) && SUCCESS.equals(params.get(RESULT_CODE)))) {
if (null == params.get(SIGN) || !(SUCCESS.equals(params.get(RETURN_CODE)) && SUCCESS.equals(params.get(RESULT_CODE))) ) {
if (LOG.isErrorEnabled()) {
LOG.error(String.format("微信支付异常return_code=%s,参数集=%s", params.get(RETURN_CODE), params));
}
return false;
}
if (null == params.get(SIGN)) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("微信支付异常:签名为空!%s=%s", OUT_TRADE_NO, params.get(OUT_TRADE_NO)));
}
return false;
}
try {
return signVerify(params, (String) params.get(SIGN)) && verifySource((String) params.get(OUT_TRADE_NO));
} catch (PayErrorException e) {
@@ -230,6 +223,7 @@ public class WxPayService extends BasePayService<WxPayConfigStorage> implements
parameters.put("total_fee", Util.conversionCentAmount(order.getPrice()));
setParameters(parameters, "attach", order.getAddition());
parameters.put("notify_url", payConfigStorage.getNotifyUrl());
setParameters(parameters, "notify_url", order);
parameters.put("trade_type", order.getTransactionType().getType());
if (null != order.getExpirationTime()) {
parameters.put("time_start", DateUtils.formatDate(new Date(), DateUtils.YYYYMMDDHHMMSS));