...
|
...
|
@@ -3,13 +3,13 @@ package com.yohoufo.order.service.pay.alipay; |
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.RSAUtils;
|
|
|
import com.yohoufo.common.utils.XMLUtil;
|
|
|
import com.yohoufo.order.config.AlipayConfig;
|
|
|
import com.yohoufo.order.constants.RefundContant;
|
|
|
import com.yohoufo.order.model.PayQueryBo;
|
|
|
import com.yohoufo.order.model.PayRefundBo;
|
|
|
import com.yohoufo.order.service.pay.alipay.bean.AlipayCustomsResponse;
|
|
|
import com.yohoufo.order.service.pay.alipay.bean.AlipayQueryCustomsResponse;
|
|
|
import com.yohoufo.order.service.pay.alipay.bean.AlipayQueryResponse;
|
|
|
import com.yohoufo.order.service.pay.alipay.bean.AlipayRefundResponse;
|
|
|
import lombok.AccessLevel;
|
...
|
...
|
@@ -85,11 +85,11 @@ public class AlipayCrossBorderService extends AbstractAlipayService { |
|
|
}
|
|
|
|
|
|
|
|
|
public AlipayCustomsResponse customsOpenApi(long orderCode, String tradeNo, double amount){
|
|
|
public AlipayCustomsResponse customsOpenApi(long orderCode, String tradeNo, double amount, String certName, String certNo){
|
|
|
|
|
|
logger.info("enter customsOpenApi to {}, {}, {}", orderCode, tradeNo, amount);
|
|
|
logger.info("enter customsOpenApi to {}, {}, {}, {}, {}", orderCode, tradeNo, amount, certName, certNo);
|
|
|
|
|
|
Map<String, String> customsParam = buildOpenApiCustoms(orderCode, tradeNo, amount);
|
|
|
Map<String, String> customsParam = buildOpenApiCustoms(orderCode, tradeNo, amount,certName, certNo);
|
|
|
String respTxt = sendOpenApiRequest(String.valueOf(orderCode), customsParam, alipayConfig.crossBorderMapiUrl());
|
|
|
|
|
|
AlipayCustomsResponse customsResponse = (AlipayCustomsResponse)XMLUtil.convertXmlStrToObject(AlipayCustomsResponse.class, respTxt);
|
...
|
...
|
@@ -101,14 +101,14 @@ public class AlipayCrossBorderService extends AbstractAlipayService { |
|
|
}
|
|
|
|
|
|
|
|
|
public AlipayCustomsResponse customsOpenQueryApi(long orderCode){
|
|
|
public AlipayQueryCustomsResponse customsOpenQueryApi(long orderCode){
|
|
|
|
|
|
logger.info("enter customsOpenQueryApi to {}", orderCode);
|
|
|
|
|
|
Map<String, String> customsParam = buildOpenApiQueryCustoms(orderCode);
|
|
|
String respTxt = sendOpenApiRequest(String.valueOf(orderCode), customsParam, alipayConfig.crossBorderMapiUrl());
|
|
|
|
|
|
AlipayCustomsResponse customsResponse = (AlipayCustomsResponse)XMLUtil.convertXmlStrToObject(AlipayCustomsResponse.class, respTxt);
|
|
|
AlipayQueryCustomsResponse customsResponse = (AlipayQueryCustomsResponse)XMLUtil.convertXmlStrToObject(AlipayQueryCustomsResponse.class, respTxt);
|
|
|
|
|
|
logger.info("exit customsOpenApi, result {}", customsResponse);
|
|
|
|
...
|
...
|
@@ -166,9 +166,11 @@ public class AlipayCrossBorderService extends AbstractAlipayService { |
|
|
* @param orderCode
|
|
|
* @param tradeNo
|
|
|
* @param amount
|
|
|
* @param certName
|
|
|
* @param certNo
|
|
|
* @return
|
|
|
*/
|
|
|
private Map<String, String> buildOpenApiCustoms(long orderCode, String tradeNo, double amount){
|
|
|
private Map<String, String> buildOpenApiCustoms(long orderCode, String tradeNo, double amount, String certName, String certNo){
|
|
|
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
|
...
|
...
|
@@ -184,6 +186,8 @@ public class AlipayCrossBorderService extends AbstractAlipayService { |
|
|
params.put("amount", String.valueOf(amount));
|
|
|
params.put("customs_place", getCustomsPlace());
|
|
|
params.put("merchant_customs_name", getMerchantCustomsName());
|
|
|
params.put("buyer_name", certName);
|
|
|
params.put("buyer_id_no", certNo);
|
|
|
|
|
|
String preSignStr = getOpenApiSignString(params, true);
|
|
|
params.put("sign", helper().sign(preSignStr,AlipayConfig.input_charset));
|
...
|
...
|
|