sparkplug / momoapi-python

MTN MoMo API Client Library for Python
MIT License
47 stars 55 forks source link

Remove phone number validation or make it optional #30

Open kafuuma opened 4 years ago

kafuuma commented 4 years ago

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.

raybesiga commented 4 years ago

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

kafuuma commented 4 years ago

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.

raybesiga commented 3 years ago

Thoughts? @mossplix

sicelo commented 3 years ago

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

mossplix commented 3 years ago

We can make it optional. That should work better

raybesiga commented 3 years ago

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