|
@@ -18,6 +18,7 @@ import java.util.function.Consumer;
|
|
|
import java.util.function.Function;
|
|
|
|
|
|
import com.huifu.adapay.core.util.StringUtil;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.redisson.api.RBucket;
|
|
|
import org.redisson.api.RedissonClient;
|
|
@@ -42,12 +43,6 @@ import com.ym.mec.biz.dal.entity.TenantOrderRecord;
|
|
|
import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
|
|
|
import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
|
-import com.ym.mec.biz.service.HfMerchantConfigService;
|
|
|
-import com.ym.mec.biz.service.OrderPayOpsService;
|
|
|
-import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
-import com.ym.mec.biz.service.TenantConfigService;
|
|
|
-import com.ym.mec.biz.service.TenantOrderRecordService;
|
|
|
-import com.ym.mec.biz.service.TenantPaymentOrderService;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.WrapperUtil;
|
|
|
import com.ym.mec.thirdparty.adapay.ConfigInit;
|
|
@@ -58,6 +53,8 @@ import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.mec.util.http.HttpUtil;
|
|
|
import com.ym.mec.util.json.JsonUtil;
|
|
|
|
|
|
+import static com.ym.mec.biz.dal.enums.OrderTypeEnum.MALL_BUY;
|
|
|
+
|
|
|
/**
|
|
|
* @author hgw
|
|
|
* Created by 2021-12-22
|
|
@@ -116,7 +113,24 @@ public class OrderPayOpsServiceImpl implements OrderPayOpsService {
|
|
|
//签名验证
|
|
|
checkSing(payParam);
|
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
- payParam.setNotifyUrl(baseApiUrl + "/api-student/studentOrder/callback/" + payParam.getOrderNo());
|
|
|
+ if(studentPaymentOrder.getType() == MALL_BUY){
|
|
|
+ String paymentChannelStr = sysConfigDao.findConfigValue(SysConfigService.PAYMENT_CHANNEL);
|
|
|
+ if(StringUtils.isBlank(paymentChannelStr)) {
|
|
|
+ paymentChannelStr = PaymentChannelEnum.ADAPAY.getCode();
|
|
|
+ }
|
|
|
+ PaymentChannelEnum paymentChannel = PaymentChannelEnum.codeOf(paymentChannelStr);
|
|
|
+ String notifyUrl = "";
|
|
|
+ if (PaymentChannelEnum.YEEPAY == paymentChannel){
|
|
|
+ notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback_yee/" + studentPaymentOrder.getTenantId();
|
|
|
+ }else if (PaymentChannelEnum.ADAPAY == paymentChannel){
|
|
|
+ notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback";
|
|
|
+ }else {
|
|
|
+ throw new BizException("支付渠道错误");
|
|
|
+ }
|
|
|
+ payParam.setNotifyUrl(notifyUrl);
|
|
|
+ }else {
|
|
|
+ payParam.setNotifyUrl(baseApiUrl + "/api-student/studentOrder/callback/" + payParam.getOrderNo());
|
|
|
+ }
|
|
|
|
|
|
//如果以上操作都没有 则应该是这一个,因为老代码就是这样写的。
|
|
|
payment = student(payParam);
|