momoapi-python icon indicating copy to clipboard operation
momoapi-python copied to clipboard

Remove phone number validation or make it optional

Open kafuuma opened this issue 5 years ago • 6 comments

Before sending a request to the MoMo API the phone number validated is and 256 is appended. However, this makes testing in sandbox with the numbers provided for testing difficult. Phone number validation should be made optional.

kafuuma avatar Jan 28 '20 15:01 kafuuma

Hi @kafuuma why do you think it is a good idea to remove required validations?

raybesiga avatar Jan 29 '20 13:01 raybesiga

Hi @raybesiga the numbers provided by mtn for sandbox testing, start with 4XXX i.e 46733123450, 46733123451, etc. so you send a request to the format becomes 2564XXX, this does not give the required response as per test cases. In my case, I have to comment out that part of the code in the package to be able to make test requests.

The second case is that when I store my numbers in the database as 25678XXXXX, 256 will be appended to the number when I send the request i.e 256256788XXX, this is not required. The solution is to either save the numbers as 78XXX and or strip save them as 25678XXX and strip the 256 when I am making a request. As you can see this all is more work. I think the best way is to make the validation optional.

kafuuma avatar Feb 13 '20 16:02 kafuuma

Thoughts? @mossplix

raybesiga avatar Dec 04 '20 08:12 raybesiga

Hi @kafuuma why do you think it is a good idea to remove required validations?

One other possibility - the library should be easily used in other MTN countries, where the code is different

sicelo avatar Dec 04 '20 08:12 sicelo

We can make it optional. That should work better

mossplix avatar Dec 04 '20 09:12 mossplix

Appreciate the suggestions @kafuuma @sicelo Pull requests welcome! 👍

raybesiga avatar Dec 04 '20 09:12 raybesiga