sparkplug / momoapi-python Goto Github PK
View Code? Open in Web Editor NEWMTN MoMo API Client Library for Python
License: MIT License
MTN MoMo API Client Library for Python
License: MIT License
Problem
Most of the code currently in master
is not tested. This means it will be hard to detect when this library starts to fail.
Solution
To ensure that the library behaves as expected, we need to add tests.
Tasks
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.
The client does not fully support the Collections
API. We need to add a module to support the following operations:
Reference
Is your feature request related to a problem? Please describe.
Currently, we don't have any validation to ensure users are invoking functions with the right parameters. The only validation we get is from the API. Ideally, we should identify errors and fail fast before they reach the API
Describe the solution you'd like
We need to add assertions on functions and constructors to ensure that the correct information is being given.
We need to add CI to facilitate automation of testing and publishing. We shall use Travis CI.
For the start, the CI should publish to pip
when a PR is reviewed and merged to master.
Progress
pypi
token and github token to Travis CI secretsThis (https://gitpitch.com/sparkplug/momo-developer-training-slides/master) momo API training will be no more when git pitch finally shuts down from march 1st 2021.
And since many people are using the API, and looking for such helpful resources, the tutorial should be moved to an open-source platform like GitHub README.
Since this link is embedded in the training docs,
The README needs to be updated to reflect the changes that are being made and will be made in the production library.
Some of the variables required to initialize the library are global, while others are product specific.
The global variables are;
The product specific ones are;
Describe the solution you'd like
We should initialize the library with global variables and then initialize the product clients with product-specific variables.
The library does not fully support the Disbursements
API. We need to add a module to support disbursements. The module must support the following operations:
Reference
Improve formatting of Markdown documents by replacing urls with links.
For example:
On Line 25 in README.md: Replace https://momodeveloper.mtn.com
with MoMo Developer Portal to make the link clickable by a developer.
Getting this error ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer')) after submitting the callback host and Ocp-Apim-Subscription-Key for my transaction yet I have a steady network connection
Why does the momo API keep throwing me the ENVIRONMENT is missing in the configuration, Exception. after i had provided one in the config={
'ENVIRONMENT': os.environ.get("https://sandbox.momodeveloper.mtn.com/collection/v1_0/bc-authorize"),
'BASE_URL': os.environ.get("BASE_URL"),
'CALLBACK_HOST': os.environ.get("http://127.0.0.1:8000"),}
The documentation stated that it was optional but when left blank or provided with one i get that Exception.....whenever i make client.requestToPay(amount='100',
mobile ='233247854320', external_id='324445335').
what could possibly be the case ....?
kindly help me
Describe the bug
There's an error when reading in the REMITTANCE_PRIMARY_KEY
environment variable. A simple typo is the keyword os.envieon
instead of os.environ
Need to add a contributing guide
We shall need to change the package name to mtn-momo
to ensure naming consistency across the different ecosystems.
Why I am getting JsonDecodeError with disbursements even when the http response is 202?
This is what I am getting back after calling transfer method;
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This is the data I am pushing through;
headers
Out[9]:
{'X-Target-Environment': 'sandbox',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'hidden',
'X-Reference-Id': 'hidden'}
data
Out[10]:
{'amount': '600',
'currency': 'EUR',
'externalId': '123456789',
'payee': {'partyIdType': 'MSISDN', 'partyId': '256772123456'},
'payerMessage': 'dd',
'payeeNote': 'dd'}
And these are the values of the resp variable;
resp
Out[20]: <Response [202]>
resp.headers
Out[21]: {'Content-Length': '0', 'Date': 'Thu, 23 May 2019 11:08:30 GMT'}
resp.status_code
Out[22]: 202
resp.text
Out[23]: ''
Is your feature request related to a problem? Please describe.
The README section talking about how to use the Disbursements imports the Disbursement class from the mtnmomo.collection
however this class is actually found in mtnmomo.disbursement
.
Describe the solution you'd like
I would like to correct the two code snippets that have this error in the README.
Is your feature request related to a problem? Please describe.
The library needs to throw custom errors depending on what errors are returned by MTN
Describe the solution you'd like
We should add custom error classes and throw them when the corresponding error occurs
Tasks
This library doesn't currently support the Remittances
API. We need to add a module to support remittances. It should support the following operations:
Reference
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.