...
|
...
|
@@ -8,6 +8,8 @@ import java.util.Map; |
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.yohoufo.order.service.pay.alipay.AlipayCrossBorderService;
|
|
|
import com.yohoufo.order.service.pay.alipay.AlipayServiceAbstract;
|
|
|
import com.yohoufo.order.service.pay.unionpay.JsUnionpayService;
|
|
|
import net.sf.oval.constraint.AssertURL;
|
|
|
import org.apache.commons.lang.StringUtils;
|
...
|
...
|
@@ -64,6 +66,9 @@ public class PaymentController { |
|
|
AlipayOuyinService alipayService;
|
|
|
|
|
|
@Autowired
|
|
|
AlipayCrossBorderService alipayCrossBorderService;
|
|
|
|
|
|
@Autowired
|
|
|
JsUnionpayService jsUnionpayService;
|
|
|
|
|
|
public static final String RETURN_CODE = "return_code";
|
...
|
...
|
@@ -243,8 +248,17 @@ public class PaymentController { |
|
|
return ;
|
|
|
}
|
|
|
|
|
|
AlipayServiceAbstract alipayServiceAbstract;
|
|
|
|
|
|
// 跨境支付宝的回调
|
|
|
if (params.containsKey("currency")){
|
|
|
alipayServiceAbstract = alipayCrossBorderService;
|
|
|
}else{
|
|
|
alipayServiceAbstract = alipayService;
|
|
|
}
|
|
|
|
|
|
//回调验证
|
|
|
if(!alipayService.notifyVerify(params)) {
|
|
|
if(!alipayServiceAbstract.notifyVerify(params)) {
|
|
|
notifyResponse.setNotifyResult(NotifyResponse.PAYMENT_NOTIFY_RESULT_VERFAIL);
|
|
|
alipayLogger.error("[{}] notification verify failed", out_trade_no);
|
|
|
return ;
|
...
|
...
|
@@ -252,7 +266,7 @@ public class PaymentController { |
|
|
|
|
|
PaymentData paymentData = null;
|
|
|
try {
|
|
|
paymentData = alipayService.getPaymentData(params);
|
|
|
paymentData = alipayServiceAbstract.getPaymentData(params);
|
|
|
|
|
|
alipayLogger.info("method alipayService.getPaymentData is {}", paymentData);
|
|
|
|
...
|
...
|
@@ -412,7 +426,7 @@ public class PaymentController { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (!trade_status.equals("TRADE_SUCCESS")) {
|
|
|
if (!trade_status.equals("TRADE_SUCCESS") && !trade_status.equals("TRADE_FINISHED")) {
|
|
|
logger.info("[{}] trade_status: {}", params.get("out_trade_no"), trade_status);
|
|
|
return false;
|
|
|
}
|
...
|
...
|
|