-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mpesa): Validate mPesa tax id format #2479
base: master
Are you sure you want to change the base?
Conversation
…mat f tax id before initiating mpesa transaction
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2479 +/- ##
==========================================
- Coverage 36.83% 36.67% -0.17%
==========================================
Files 403 407 +4
Lines 32152 32386 +234
==========================================
+ Hits 11843 11876 +33
- Misses 20309 20510 +201 ☔ View full report in Codecov by Sentry. |
dashboard/src2/components/billing/mpesa/BuyPrepaidCreditsMpesa.vue
Outdated
Show resolved
Hide resolved
if(this.taxIdInput){ | ||
if (!pattern.test(this.taxIdInput)) { | ||
throw new DashboardError( | ||
"Tax ID should be in the format 'A123456789A'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't show example Tax ID in the error message. Rather inform them about the correct format or just throw "invalid tax id".
Can you please also add somewhere in comment that this format is only applicable for Kenya?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKay, I will
@maniamartial Please setup pre-commit in your local before raising a PR for linting. |
@maniamartial is this ready to merge? |
@shadrak98 Sure |
Tax id starts should start with capital letter, also end in capital letter and in between contain 8 numerical numbers.

Validating this using regez expression before initiating a transaction.
eg .