diff --git a/.gitignore b/.gitignore index 2de402a..31c21be 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ .classpath .project bin/* +KYCAdvanced.jar +KYCAdvanced/* +KYCAdvanced.rar +KYCAdvanced.zip diff --git a/config.json b/config.json index a10a4c6..d8bb9a8 100644 --- a/config.json +++ b/config.json @@ -153,5 +153,7 @@ "password": "gwg", "host": "172.30.1.50:8080", "url": "http://172.30.1.50:8080/axis2/services/KYCService01.KYCService01HttpSoap11Endpoint" - } + }, + "restrictResult": true, + "restrictValue": 50 } \ No newline at end of file diff --git a/middleware.jar b/middleware.jar deleted file mode 100644 index 09ede2b..0000000 Binary files a/middleware.jar and /dev/null differ diff --git a/src/com/tonebeller/middleware/Middleware.java b/src/com/tonebeller/middleware/Middleware.java index a1e42ce..25fad42 100644 --- a/src/com/tonebeller/middleware/Middleware.java +++ b/src/com/tonebeller/middleware/Middleware.java @@ -21,6 +21,13 @@ public static void main(String[] args) { + Middleware.class.getName()); Customer customer = new Customer(config); config.setCustomer(customer); + if (config.json.getBoolean("restrictResult")){ + System.out.println(Integer.parseInt(customer.getRisk())); + if (Integer.parseInt(customer.getRisk()) == 0 || Integer.parseInt(customer.getRisk()) > config.json.getInt("restrictValue")){ + System.out.println("\n\n==== STOPPED MIDDLEWARE DUE TO NO RISK NOT FOUND OR HIGHER THAN ALLOWED===\n\n"); + System.exit(-1); + } + } new Webservice(); } catch(Exception e){ diff --git a/src/com/tonebeller/middleware/Webservice.java b/src/com/tonebeller/middleware/Webservice.java index cec07f8..af4e750 100644 --- a/src/com/tonebeller/middleware/Webservice.java +++ b/src/com/tonebeller/middleware/Webservice.java @@ -84,13 +84,13 @@ private Webservice doKYC(){ try { this.cookies = null; System.out.println("\n\n ==== KYC RENAME === \n\n"); - System.out.println(this.responseBody); Document document = Jsoup.parse(this.responseBody); Elements td = document.getElementsByClass("message"); System.out.println("\n\n === " + td.text()); Pattern p = Pattern.compile("(Txn Complete: )([0-9]+)([0-9A-Za-z :,]+)"); Matcher m = p.matcher(td.text()); if (m.find()) { + System.out.println("\nRENAME TO: " + m.find()); String kycWsUser = this.config.json.getJSONObject("kyc").getString("username"); kycWsPass = this.config.json.getJSONObject("kyc").getString("password"); this.config.setNewId(m.group(2)); @@ -107,7 +107,7 @@ private Webservice doKYC(){ req.put("contents", new JSONObject()); req.put("url", this.config.json.getJSONObject("kyc").getString("url")); this.sendPost(req, request); - } + } else System.out.println("Failed Renaming, no new ID"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace();