feat(b2p): add sync Business to Pochi client - #176
Open
LewisJassy wants to merge 2 commits into
Open
Conversation
Daraja B2Pochi payments need a typed request/callback layer so disbursements to Pochi La Biashara can be initiated and reconciled without hand-parsing payloads.
Added support for B2Pochi payments, including a new callback processing method and service integration. Updated README to include usage examples and details for the B2Pochi service.
RafaelJohn9
requested changes
Aug 31, 2026
RafaelJohn9
left a comment
Member
There was a problem hiding this comment.
Hello @LewisJassy , Thank you for an awesome PR, we are off to a great start, few changes to consider though
- Fix the CI error
- We add the Async implementation too, see https://github.com/Byte-Barn/mpesakit/tree/master/mpesakit/mpesa_ratiba and https://github.com/Byte-Barn/mpesakit/blob/master/mpesakit/mpesa_client.py on how we handle async in the repo
- Update docs/
Otherwise this is a great start.
Note
Apologies for the late review, if you are done with changes and ready for rereview you can always request it or tag me 🤝 .
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
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.
Adds a synchronous Business to Pochi (B2Pochi) client for paying a customer's Pochi La Biashara wallet via
/mpesa/b2pochi/v1/paymentrequest.New feature (non-breaking change that adds functionality)
Tests (addition of tests)
Unit tests in
tests/unit/b2p/test_b2p.py(26 passed)Ruff lint/format on
mpesakit/b2pandtests/unit/b2pmypy mpesakit/b2pCoverage includes request validation (CommandID, PartyB normalization, Remarks/Occassion length), the acknowledgement response, nested Daraja success/failure callbacks, and timeout callback schemas.
#159