Authored by tanling

推送支付单

... ... @@ -5,7 +5,6 @@ import lombok.ToString;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD)
... ... @@ -21,11 +20,15 @@ public class AlipayCustomsResponse {
private Response response;
@XmlAccessorType(XmlAccessType.FIELD)
@Data
@ToString
public static class Response {
private Alipay alipay;
@XmlAccessorType(XmlAccessType.FIELD)
@Data
@ToString
public static class Alipay {
private String result_code;
... ...
... ... @@ -74,12 +74,21 @@ public class CustomsSupportService {
AlipayCustomsResponse alipayCustomsResponse = crossBorderService.customsOpenApi(buyerOrder.getOrderCode(),
ordersPay.getSerialNo(), ordersPay.getAmount().doubleValue(), zhimaCert.getCertName(), zhimaCert.getCertNo());
String identityCheck = null;
String errorCode = null;
// response/alipay 结构不一定存在
if (alipayCustomsResponse.getResponse().getAlipay() != null){
identityCheck = alipayCustomsResponse.getResponse().getAlipay().getIdentity_check();
errorCode = alipayCustomsResponse.getResponse().getAlipay().getDetail_error_code();
}
// 推送失败 || 下单人和支付人不一致
if ("F".equalsIgnoreCase(alipayCustomsResponse.getIs_success()) || "F".equalsIgnoreCase(alipayCustomsResponse.getIdentity_check())){
if ("F".equalsIgnoreCase(alipayCustomsResponse.getIs_success()) || "F".equalsIgnoreCase(identityCheck)){
String error = StringUtils.isEmpty(alipayCustomsResponse.getResult_code()) ? alipayCustomsResponse.getError() : alipayCustomsResponse.getResult_code();
String error = StringUtils.isEmpty(errorCode) ? alipayCustomsResponse.getError() : errorCode;
if ("F".equalsIgnoreCase(alipayCustomsResponse.getIdentity_check())){
if ("F".equalsIgnoreCase(identityCheck)){
error = CustomsErrorMsg.IDENTITY_CHECK_F.name();
}
... ...