|
|
@@ -5,8 +5,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.pay.common.ResultCode;
|
|
|
import com.fdkankan.pay.entity.Order;
|
|
|
import com.fdkankan.pay.entity.PaypalConfig;
|
|
|
-import com.fdkankan.pay.entity.WxConfig;
|
|
|
import com.fdkankan.pay.exception.BusinessException;
|
|
|
+import com.fdkankan.pay.response.OpenPayResponse;
|
|
|
import com.fdkankan.pay.service.IOrderService;
|
|
|
import com.fdkankan.pay.service.IPaypalConfigService;
|
|
|
import com.fdkankan.pay.util.CacheUtil;
|
|
|
@@ -59,7 +59,7 @@ public class PaypalService {
|
|
|
|
|
|
|
|
|
|
|
|
- public JSONObject payPalPay(String orderSn, String body, BigDecimal totalFee, PaypalConfig paypalConfig) throws Exception {
|
|
|
+ public OpenPayResponse payPalPay(String orderSn, String body, BigDecimal totalFee, PaypalConfig paypalConfig) throws Exception {
|
|
|
PayPalmentEx payPalmentEx = new PayPalmentEx();
|
|
|
payPalmentEx.setOrderSn(orderSn);
|
|
|
payPalmentEx.setOrderTotal(totalFee);
|
|
|
@@ -70,10 +70,12 @@ public class PaypalService {
|
|
|
for(Links links : payment.getLinks()){
|
|
|
if(links.getRel().equals("approval_url")){
|
|
|
// 客户付款登陆地址
|
|
|
- JSONObject j = new JSONObject();
|
|
|
- j.put("redirect", links.getHref());
|
|
|
- j.put("price", totalFee);
|
|
|
- return j;
|
|
|
+ OpenPayResponse openPayResponse = new OpenPayResponse();
|
|
|
+ openPayResponse.setH5Url(links.getHref());
|
|
|
+ openPayResponse.setQrCodeUrl(links.getHref());
|
|
|
+ openPayResponse.setOrderSn(orderSn);
|
|
|
+ openPayResponse.setPayType(5);
|
|
|
+ return openPayResponse;
|
|
|
}
|
|
|
}
|
|
|
throw new BusinessException(ResultCode.PAYPAL_ERROR);
|