Skip to content

feat(mpesa): Regional Partner Payment Payout #2596

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

Merged
merged 3 commits into from
Apr 14, 2025

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.

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 9.85915% with 64 lines in your changes missing coverage. Please review.

Project coverage is 36.56%. Comparing base (b554b12) to head (f757df7).
Report is 230 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% 24 Missing ⚠️
press/api/regional_payments/mpesa/utils.py 31.81% 15 Missing ⚠️

❌ Your patch status has failed because the patch coverage (9.85%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2596      +/-   ##
==========================================
- Coverage   36.58%   36.56%   -0.03%     
==========================================
  Files         411      416       +5     
  Lines       32843    33312     +469     
==========================================
+ Hits        12015    12179     +164     
- Misses      20828    21133     +305     

☔ 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 shadrak98 changed the title feat(mpesa) - Regional Partner Payment Payout feat(mpesa): Regional Partner Payment Payout Apr 14, 2025
@shadrak98 shadrak98 merged commit d28492d into frappe:master Apr 14, 2025
7 of 9 checks passed
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