diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index 6ba6117f8..7ab732b54 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -147,4 +147,6 @@ public interface RetailAppService { void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientUpdateInfo); void applyToCompliance(JSONObject device); + + void sendVerifyEmail(JSONObject device); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index a894a94be..e3a337364 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -387,6 +387,19 @@ public class RetailAppServiceImp implements RetailAppService { } + @Override + public void sendVerifyEmail(JSONObject device) { + JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); + JSONObject account = clientAccountMapper.findById(device.getString("account_id")); + if(client==null){ + throw new NotFoundException("Merchant Not Found"); + } + if(account==null){ + throw new NotFoundException("Account Not Found"); + } + clientManager.sendVerifyEmail(client,account.getString("account_id")); + } + @Override public void updateClient(JSONObject device, AppClientBean appClientBean) { String clientType = device.getString("client_type"); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index b9261e87a..073dc0b07 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -264,6 +264,12 @@ public class RetailAppController { return retailAppService.getClientInfoMe(device); } + @RequestMapping(value = "/client/verify/email", method = RequestMethod.PUT) + @ResponseBody + public void sendVerifyEmail(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { + retailAppService.sendVerifyEmail(device); + } + @RequestMapping(value = "/client/check", method = RequestMethod.GET) public JSONObject getCheckClientInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { JSONObject defaultResult = new JSONObject();