Selaa lähdekoodia

fix原生支付服务

Eric 1 vuosi sitten
vanhempi
commit
53d1a226dc

+ 8 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PaymentMerchantConfigServiceImpl.java

@@ -22,6 +22,7 @@ import com.yonge.cooleshow.biz.dal.service.PaymentMerchantConfigService;
 
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PostConstruct;
 import java.util.List;
 import java.util.List;
+import java.util.Objects;
 
 
 /**
 /**
  * 支付三方账户配置
  * 支付三方账户配置
@@ -113,7 +114,9 @@ public class PaymentMerchantConfigServiceImpl extends ServiceImpl<PaymentMerchan
                     wxPayConfig.setPayType(config.getPaymentVendor());
                     wxPayConfig.setPayType(config.getPaymentVendor());
                     wxPayConfig.setPayNotifyUrl(properties.getPayNotifyUrl());
                     wxPayConfig.setPayNotifyUrl(properties.getPayNotifyUrl());
                     wxPayConfig.setRefundNotifyUrl(properties.getRefundNotifyUrl());
                     wxPayConfig.setRefundNotifyUrl(properties.getRefundNotifyUrl());
-                    wxPayConfig.setFeeRate(properties.getWxpay().getFeeRate());
+                    if (Objects.nonNull(properties.getWxpay())) {
+                        wxPayConfig.setFeeRate(properties.getWxpay().getFeeRate());
+                    }
 
 
                     try {
                     try {
                         // 初始化微信支付插件
                         // 初始化微信支付插件
@@ -137,10 +140,12 @@ public class PaymentMerchantConfigServiceImpl extends ServiceImpl<PaymentMerchan
                     aliPayConfig.setEncryptType(config.getAlipayContentSignType());
                     aliPayConfig.setEncryptType(config.getAlipayContentSignType());
                     aliPayConfig.setEncryptKey(config.getAliPayContentSignKey());
                     aliPayConfig.setEncryptKey(config.getAliPayContentSignKey());
                     aliPayConfig.setUseCert(false);
                     aliPayConfig.setUseCert(false);
+                    aliPayConfig.setPayType(config.getPaymentVendor());
                     aliPayConfig.setPayNotifyUrl(properties.getPayNotifyUrl());
                     aliPayConfig.setPayNotifyUrl(properties.getPayNotifyUrl());
                     aliPayConfig.setRefundNotifyUrl(properties.getRefundNotifyUrl());
                     aliPayConfig.setRefundNotifyUrl(properties.getRefundNotifyUrl());
-                    aliPayConfig.setFeeRate(properties.getAlipay().getFeeRate());
-                    aliPayConfig.setPayType(config.getPaymentVendor());
+                    if (Objects.nonNull(properties.getAlipay())) {
+                        aliPayConfig.setFeeRate(properties.getAlipay().getFeeRate());
+                    }
 
 
                     try {
                     try {
                         // 初始化支付宝支付插件
                         // 初始化支付宝支付插件