Authored by tanling

推送支付单

@@ -85,6 +85,15 @@ public class AlipayCrossBorderService extends AbstractAlipayService { @@ -85,6 +85,15 @@ public class AlipayCrossBorderService extends AbstractAlipayService {
85 } 85 }
86 86
87 87
  88 + /**
  89 + *
  90 + * @param orderCode
  91 + * @param tradeNo
  92 + * @param amount 人民币 ordes_pay中的amount支付回调给的是港币
  93 + * @param certName
  94 + * @param certNo
  95 + * @return
  96 + */
88 public AlipayCustomsResponse customsOpenApi(long orderCode, String tradeNo, double amount, String certName, String certNo){ 97 public AlipayCustomsResponse customsOpenApi(long orderCode, String tradeNo, double amount, String certName, String certNo){
89 98
90 logger.info("enter customsOpenApi to {}, {}, {}, {}, {}", orderCode, tradeNo, amount, certName, certNo); 99 logger.info("enter customsOpenApi to {}, {}, {}, {}, {}", orderCode, tradeNo, amount, certName, certNo);
@@ -72,19 +72,22 @@ public class CustomsSupportService { @@ -72,19 +72,22 @@ public class CustomsSupportService {
72 72
73 try{ 73 try{
74 AlipayCustomsResponse alipayCustomsResponse = crossBorderService.customsOpenApi(buyerOrder.getOrderCode(), 74 AlipayCustomsResponse alipayCustomsResponse = crossBorderService.customsOpenApi(buyerOrder.getOrderCode(),
75 - ordersPay.getSerialNo(), ordersPay.getAmount().doubleValue(), zhimaCert.getCertName(), zhimaCert.getCertNo()); 75 + ordersPay.getSerialNo(), buyerOrder.getAmount().doubleValue(), zhimaCert.getCertName(), zhimaCert.getCertNo());
76 76
77 String identityCheck = null; 77 String identityCheck = null;
78 String errorCode = null; 78 String errorCode = null;
  79 + String resultCode = null;
79 80
80 // response/alipay 结构不一定存在 81 // response/alipay 结构不一定存在
81 if (alipayCustomsResponse.getResponse() != null && alipayCustomsResponse.getResponse().getAlipay() != null){ 82 if (alipayCustomsResponse.getResponse() != null && alipayCustomsResponse.getResponse().getAlipay() != null){
82 identityCheck = alipayCustomsResponse.getResponse().getAlipay().getIdentity_check(); 83 identityCheck = alipayCustomsResponse.getResponse().getAlipay().getIdentity_check();
83 errorCode = alipayCustomsResponse.getResponse().getAlipay().getDetail_error_code(); 84 errorCode = alipayCustomsResponse.getResponse().getAlipay().getDetail_error_code();
  85 + resultCode = alipayCustomsResponse.getResponse().getAlipay().getResult_code();
84 } 86 }
85 87
86 - // 推送失败 || 下单人和支付人不一致  
87 - if ("F".equalsIgnoreCase(alipayCustomsResponse.getIs_success()) || "F".equalsIgnoreCase(identityCheck)){ 88 + // 推送失败(验签错误) || result_code=FAIL || 下单人和支付人不一致
  89 + if ("F".equalsIgnoreCase(alipayCustomsResponse.getIs_success()) || "FAIL".equalsIgnoreCase(resultCode)
  90 + || "F".equalsIgnoreCase(identityCheck)){
88 91
89 String error = StringUtils.isEmpty(errorCode) ? alipayCustomsResponse.getError() : errorCode; 92 String error = StringUtils.isEmpty(errorCode) ? alipayCustomsResponse.getError() : errorCode;
90 93