Skip to content

Commit

Permalink
Remove phone number validation
Browse files Browse the repository at this point in the history
Remove check for mobile number using regex since paynow validates mobile numbers as outlined in issue #7 brought up by @tzifudzi
  • Loading branch information
iammerus committed Dec 19, 2018
1 parent 68b1cf5 commit 4e4db6e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/webdev/payments/Paynow.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,7 @@ public final InitResponse sendMobile(Payment payment, String phone, String metho
if (payment.getTotal().compareTo(BigDecimal.ZERO) <= 0) {
throw new EmptyCartException();
}

if (!phone.matches("07([7,8])((\\1=7)[1-9]|[2-5])\\d{6}")) {
throw new IllegalArgumentException("Invalid phone number");
}


return initMobile(payment, phone, method);
}

Expand Down Expand Up @@ -332,4 +328,4 @@ private HashMap<String, String> formatMobileInitRequest(Payment payment, String

return items;
}
}
}

0 comments on commit 4e4db6e

Please sign in to comment.