skip bsb check on sandbox mode

master
yixian 3 years ago
parent e02ae9cca7
commit 2269b995fd

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.gateway.beans;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.system.core.impl.ClientContractServiceImpl;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
@ -11,6 +12,7 @@ import lombok.Data;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMethod;
import java.io.IOException;
@ -47,6 +49,8 @@ public class ClientSettleConfig {
private String activeTime;
@JSONField(name = "expire_time")
private String expireTime;
@Value("${app.sandbox:false}")
private boolean sandboxMode;
private JSONObject bankQueryInfo;
private Date activeTimeDate;
@ -78,10 +82,12 @@ public class ClientSettleConfig {
throw new BadRequestException("PARAM_ERROR:Invalid Account Name format");
}
if (!sandboxMode) {
bankQueryInfo = getBankInfo(bsbNo);
if (bankQueryInfo == null || bankQueryInfo.isEmpty() || !bankQueryInfo.getBooleanValue("valid")) {
throw new BadRequestException("PARAM_ERROR:BSB No is invalid");
}
}
try {
activeTimeDate = DateUtils.parseDate(activeTime, new String[]{"yyyy-MM-dd HH:mm:ss"});
} catch (ParseException e) {

Loading…
Cancel
Save