Authored by tanling

推送支付单

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