From f11a3a408b2f0c2dfdb490dfd9c2e261071006ce Mon Sep 17 00:00:00 2001 From: eason Date: Thu, 7 Jun 2018 10:14:12 +0800 Subject: [PATCH] fix bsb number api --- .../application/core/impls/SimpleClientApplyServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index abdc2fa9d..49a119a95 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -18,6 +18,7 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; +import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.mail.SendMail; @@ -413,8 +414,12 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute(); if (result.isSuccess()) { banInfo = result.getResponseContentJSONObj(); + if (!banInfo.getBoolean("valid")){ + throw new NotFoundException("BSB Number Not Found"); + } } } catch (URISyntaxException | IOException e) { + throw new ServerErrorException(); } return banInfo; }