|
@@ -4,6 +4,7 @@ import cn.kdan.pdf.backend.core.constant.OrderConstant;
|
|
import cn.kdan.pdf.backend.core.enums.ClientEnum;
|
|
import cn.kdan.pdf.backend.core.enums.ClientEnum;
|
|
import cn.kdan.pdf.backend.core.model.Subscriptions;
|
|
import cn.kdan.pdf.backend.core.model.Subscriptions;
|
|
import cn.kdan.pdf.backend.core.service.AlipayService;
|
|
import cn.kdan.pdf.backend.core.service.AlipayService;
|
|
|
|
+import cn.kdan.pdf.backend.core.utils.CommonBusinessUtils;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alipay.api.AlipayApiException;
|
|
import com.alipay.api.AlipayApiException;
|
|
import com.alipay.api.AlipayClient;
|
|
import com.alipay.api.AlipayClient;
|
|
@@ -19,6 +20,7 @@ import com.alipay.api.response.AlipayTradeQueryResponse;
|
|
import enums.CommonEnum;
|
|
import enums.CommonEnum;
|
|
import exception.BackendRuntimeException;
|
|
import exception.BackendRuntimeException;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -38,6 +40,8 @@ public class AlipayServiceImpl implements AlipayService {
|
|
@Autowired
|
|
@Autowired
|
|
private Environment config;
|
|
private Environment config;
|
|
|
|
|
|
|
|
+ private static final String rightUrl = "http://17pdf.com/";
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 支付宝开放平台接收 request 请求对象后
|
|
* 支付宝开放平台接收 request 请求对象后
|
|
* 会为开发者生成一个html形式的form表单,包含自动提交的脚本
|
|
* 会为开发者生成一个html形式的form表单,包含自动提交的脚本
|
|
@@ -77,13 +81,19 @@ public class AlipayServiceImpl implements AlipayService {
|
|
request = new AlipayTradeAppPayRequest();
|
|
request = new AlipayTradeAppPayRequest();
|
|
}
|
|
}
|
|
// AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
|
|
// AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
|
|
|
|
+// String outUrl = CommonBusinessUtils.getOutUrl();
|
|
|
|
+ String property = "";
|
|
if(CommonEnum.SubscriptionTypeEnum.SET_PRICING.value().equals(subscription.getTargetType())){
|
|
if(CommonEnum.SubscriptionTypeEnum.SET_PRICING.value().equals(subscription.getTargetType())){
|
|
- request.setReturnUrl(config.getProperty("ali.pay.setPricingReturnUrl"));
|
|
|
|
|
|
+ property = config.getProperty("ali.pay.setPricingReturnUrl");
|
|
}else if(CommonEnum.SubscriptionTypeEnum.PRICING.value().equals(subscription.getTargetType())){
|
|
}else if(CommonEnum.SubscriptionTypeEnum.PRICING.value().equals(subscription.getTargetType())){
|
|
- request.setReturnUrl(config.getProperty("ali.pay.pricingReturnUrl"));
|
|
|
|
|
|
+ property = config.getProperty("ali.pay.pricingReturnUrl");
|
|
}else{
|
|
}else{
|
|
- request.setReturnUrl(config.getProperty("ali.pay.returnUrl"));
|
|
|
|
|
|
+ property = config.getProperty("ali.pay.returnUrl");
|
|
}
|
|
}
|
|
|
|
+// if(StringUtils.isNotBlank(outUrl)){
|
|
|
|
+// property = property.replace(rightUrl,outUrl);
|
|
|
|
+// }
|
|
|
|
+ request.setReturnUrl(property);
|
|
//设置回调return_url、响应url
|
|
//设置回调return_url、响应url
|
|
request.setNotifyUrl(config.getProperty("ali.pay.notifyUrl"));
|
|
request.setNotifyUrl(config.getProperty("ali.pay.notifyUrl"));
|
|
request.setBizModel(model);
|
|
request.setBizModel(model);
|