-
Notifications
You must be signed in to change notification settings - Fork 143
Library updates #57
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
Open
tu-ru
wants to merge
23
commits into
safaricom:master
Choose a base branch
from
tu-ru:npm-standard-lib
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Library updates #57
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated the mpesa-node library to use latest npm packages. Added new API's from daraja 2.0, new tests with an optional result body, types for typescript users, better babel configuration for seamless es6 mocha tests, and better folder structure
Implemented a 4 sec timeout code to exit the testing stage effectively, as I was facing issues with closing ngrok and app server properly. I have also fixed the transaction status API route
Cleaning up unnecessary files and re-structuring the folders, for a more npm like standard setup
created a .env.example file for users to rely on when fetching their keys from daraja 2.0
Following proper naming conventions, I came up with
…th. All this to push on proper library management
…tically, without having to explicitly passing them as function parameters, maintaining credential security, and simplifying the API parameter section. The mechanism automatically sets baseURL based on the environment, and chooses which .env to use, depending on how the user uses the library
…ment, to handle errors in a more user-friendly way. I have also updated the core api files to have advanced error logging
The lib has capability to automatically determine the certificate based on the provided .env file
…ocs and root README.md for better readability. This commit also houses better tests, with optional callback handling. I've also performed minor enhancements, just to streamline the library and make it better for everyone
…'s explicitly URL. This helps avoid confusions in realtime usage
…ave omitted, taxRemittance and c2bRegister because of the extra external configurations, required for them to perform properly. I have combined M-pesa query and M-pesa express into one test file, since the CheckoutRequestID released by M-pesa express, is expected to be passed down to M-pesa query. I have also reformatted the whole code base and updated the docs
…rd addition. This will ensure that developers searching for different variations of M-Pesa integrations, SDKs, and modules will find your library more easily
…transaction. Added multiline comments in each test file, describing what the test does
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored for Better Framework Compatibility
This update makes the library easier to integrate with modern JavaScript frameworks. It works well in Vite + React + TypeScript (simulation mode), with more tests planned for other frameworks.
Key Updates
CommonJS
users must settype="module"
inpackage.json
.README.md
is up-to-date with the current updates. The library now contains localJSDocs
documentation, adding accessibilityNext Steps
This update makes the library simpler and more flexible. Open to feedback!