汇付基础响应

This commit is contained in:
2023-08-21 13:24:07 +08:00
parent 3893afaa06
commit 68444ebc23
2 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
package com.jsowell.adapay.response;
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
import com.jsowell.common.util.StringUtils;
import lombok.*;
/**
@@ -20,4 +22,12 @@ public class AdapayBaseResponse {
private String error_code;
private String error_msg;
private String error_type;
public boolean isSuccess() {
return StringUtils.equals(status, AdapayStatusEnum.SUCCEEDED.getValue());
}
public boolean isNotSuccess() {
return !isSuccess();
}
}

View File

@@ -663,7 +663,7 @@ public class AdapayService {
if (response != null) {
QueryDrawCashResponse queryDrawCashResponse = JSON.parseObject(JSON.toJSONString(response), QueryDrawCashResponse.class);
if (queryDrawCashResponse == null || !StringUtils.equals(queryDrawCashResponse.getStatus(), "succeeded")) {
if (queryDrawCashResponse == null || queryDrawCashResponse.isNotSuccess()) {
return null;
}
QueryDrawCashResponse.Cash cash = queryDrawCashResponse.getCashList().get(0);