Skip to content

Commit

Permalink
Production build
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedrhuma committed Oct 30, 2018
1 parent b024a3f commit 25f1caa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.classpath
.project
bin/*
KYCAdvanced.jar
KYCAdvanced/*
KYCAdvanced.rar
KYCAdvanced.zip
4 changes: 3 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Binary file removed middleware.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions src/com/tonebeller/middleware/Middleware.java
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
4 changes: 2 additions & 2 deletions src/com/tonebeller/middleware/Webservice.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
Expand Down

0 comments on commit 25f1caa

Please sign in to comment.