Skip to content
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

feat(mpesa): Partner Transaction Payout #2561

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maniamartial
Copy link
Contributor

feat: enable payment reconciliation for partner local payments

This feature allows partners and Frappe to reconcile payments collected through local payment methods. It introduces two main doctypes for managing and tracking these transactions:

  1. Payment Partner Transaction

    • Records all customer transactions processed by partners.
    • Contains a submitted_to_frappe field, which is initially unchecked.
    • All local payments are logged in this doctype.

    Payment Partner Transaction

  2. Partner Payment Payout

    • Facilitates the reconciliation process by fetching and processing partner transactions.
    • Users can filter by partner, payment gateway, and date range to fetch relevant transactions.
    • The child table Partner Payment Payout Item lists all matching transactions.
    • Displays a summary with the total amount, commission (retained by the partner), and net amount (paid to Frappe).

    Partner Payment Payout

    • Upon submission, the corresponding Payment Partner Transaction records are updated to mark them as submitted to Frappe.
    • If the payout is canceled, the submitted_to_frappe flag is reverted.

Frontend Integration:

  • On the Partnership Page, the "Partner Payout" tab shows all payouts for the logged-in partner.

    Partner Payout Tab

  • Users can create new payouts by selecting filters (partner, payment gateway, date range) and fetching transactions.

    Payout Page

  • The payout process is finalized upon submission, creating a Partner Payment Payout record in the backend and updating related transactions.

    Payout Summary

This implementation improves transparency and accuracy in tracking partner payments and ensures proper reconciliation with Frappe.

@maniamartial
Copy link
Contributor Author

I will push the partner report later once this is merged. PR seems to be large enough to add more files.

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 8.95522% with 61 lines in your changes missing coverage. Please review.

Project coverage is 36.61%. Comparing base (b554b12) to head (df25c9c).
Report is 47 commits behind head on master.

Files with missing lines Patch % Lines
...ss/press/report/payment_partner/payment_partner.py 0.00% 25 Missing ⚠️
...e/partner_payment_payout/partner_payment_payout.py 0.00% 23 Missing ⚠️
press/api/regional_payments/mpesa/utils.py 31.57% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2561      +/-   ##
==========================================
+ Coverage   36.58%   36.61%   +0.03%     
==========================================
  Files         411      412       +1     
  Lines       32843    33032     +189     
==========================================
+ Hits        12015    12096      +81     
- Misses      20828    20936     +108     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shadrak98
Copy link
Contributor

I will push the partner report later once this is merged. PR seems to be large enough to add more files.

No need to wait for this to be merged, you can raise another PR

@shadrak98 shadrak98 changed the title feat - Partner Payment Payout feature with routing and transaction handling for Regional payments feat(mpesa): Partner Transaction Payout Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants