skip bsb check on sandbox mode

master
yixian 4 years ago
parent 023883c585
commit 6e16f2730f

@ -44,7 +44,7 @@ public class ClientRegisterInfo {
private static String[] WHITE_LIST = {"parentPartnerCode", "notifyUrl"};
public void checkParamsInvalid() {
public void checkParamsInvalid(boolean sandboxMode) {
try {
for (Field field : getClass().getDeclaredFields()) {
field.setAccessible(true);
@ -56,7 +56,7 @@ public class ClientRegisterInfo {
contactConfig.checkParamsInvalid();
legalConfig.checkParamsInvalid();
payConfig.checkParamsInvalid();
settleConfig.checkParamsInvalid();
settleConfig.checkParamsInvalid(sandboxMode);
complianceFileConfig.checkParamsInvalid();
} catch (IllegalAccessException e) {
logger.error("gateway api register client error : {}", e.getMessage());

@ -2,7 +2,6 @@ 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;
@ -12,7 +11,6 @@ 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;
@ -49,15 +47,13 @@ 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;
private static String[] WHITE_LIST = {"bankQueryInfo", "activeTimeDate"};
private static Pattern ACCOUNT_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9 &]+$");
public void checkParamsInvalid() throws IllegalAccessException {
public void checkParamsInvalid(boolean sandboxMode) throws IllegalAccessException {
for (Field field : getClass().getDeclaredFields()) {
field.setAccessible(true);
if (field.get(this) == null && !Arrays.asList(WHITE_LIST).contains(field.getName())) {

@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMethod;
@ -65,6 +66,8 @@ public class GatewayMerchantApplyImpl implements GatewayMerchantApply {
private ClientManager clientManager;
@Resource
private SysConfigManager sysConfigManager;
@Value("${app.sandbox:false}")
private boolean sandboxMode;
@Resource
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Resource
@ -84,7 +87,7 @@ public class GatewayMerchantApplyImpl implements GatewayMerchantApply {
@Transactional
public JSONObject applicationMerchant(JSONObject org, JSONObject registerInfo) {
ClientRegisterInfo registerBean = JSON.toJavaObject(registerInfo, ClientRegisterInfo.class);
registerBean.checkParamsInvalid();
registerBean.checkParamsInvalid(sandboxMode);
JSONObject result = new JSONObject();
JSONObject manager = managerMapper.findAvailableByLoginIdAndOrgId(registerBean.getApplyId(), org.getString("org_id"));
if (manager == null) {

Loading…
Cancel
Save