Skip to content

feat(payments): pay teams their share through Route linked accounts - #709

Draft
harshtandiya wants to merge 2 commits into
developfrom
ccr-a418e345-z69zwo
Draft

harshtandiya wants to merge 2 commits into
developfrom
ccr-a418e345-z69zwo

Conversation

@harshtandiya

@harshtandiya harshtandiya commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

When BWH takes a payment for a team's event, the team's share now goes to the team's Razorpay linked account. The share is the total less the platform fee, held until two days after the event. The gateway side is bwhtech/bwh_payments#34, which must merge, and be backported to v1-stable, first.

Checkout (buzz/payouts.py, PayoutSplit). Bookings and sponsorships both get the split. Checkout collects in full as before when:

  • the platform fee is 0, or
  • the event's team has no Active linked account on the chosen gateway, or
  • the gateway cannot split the currency (Route is INR only).

Buzz Settings

  • platform_fee_percent: 0 turns payouts off, so self-hosted sites are unaffected. Anything else must be at least 3%, so the fee covers Razorpay's charges.
  • payout_gateway: the profile teams onboard on.

Hold

  • The hold ends at the event end + 2 days, in the event's time zone.
  • Moving an event's dates moves the hold on its paid transfers, in a background job.

Refunds: no Buzz change. bwh_payments reverses the team's share in proportion before refunding.

Onboarding API (buzz.api.payouts), for the dashboard form that follows: get_payout_account, submit_payout_account, refresh_payout_account.

  • Team Owner only, because it decides where the money goes.
  • Behind the new feature_payouts flag.
  • Every Owner is emailed when the details change.
  • Business and bank details go through to the gateway and are never stored or returned.

Defaults to confirm:

  • The fee is charged on the total paid, tax included.
  • Our fee is refunded in proportion.
  • Teams without an account keep today's flow.
  • The CA question on TDS u/s 194-O and GST TCS u/s 52 is still open.

Demo

No UI change; the dashboard form is a follow-up.

Testing

  • New tests: 23, all passing.
    • buzz.tests.test_payouts (14): the split amount, the hold and its time zone, payouts off, currency and missing-account fallbacks, rounding, half and full refund reversals, sponsorships, fee validation, holds following an event move.
    • buzz.api.payouts.test_payouts (9): submit and refresh, requirements, Owner-only, the flag, a missing payout gateway, field-level validation errors, the Owner email.
  • Full suite: bench run-tests --app buzz ran 1768 tests on a local bench, with 10 failures. None is in a module this PR touches, and each occurs on develop too in this environment:
    • 7 Zoom tests: zoom_integration is not installed in this bench.
    • 2 sitemap tests: they pass alone and fail only in the full run, where frappe.local.request is left empty by an earlier test.
    • 1 test in test_move_payments_to_bwh_payments: this bench runs bwh_payments develop, and CI pins v1-stable.
  • ruff 0.8.1 and Frappe's semgrep rules are clean on the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMKwzThvcD1uQmnMcgJKHt

When the platform fee is set and an event's team has an active linked
account on the chosen gateway, the payment link sends the team the total
less the fee, held until two days after the event in its own time zone.
Otherwise checkout collects in full as before.

- Buzz Settings: platform_fee_percent (0 turns payouts off, else at
  least 3% so the fee covers Razorpay's charges) and payout_gateway.
- PayoutSplit builds the split for bookings and sponsorships alike.
- Refunds need no Buzz change: bwh_payments reverses the team's share
  in proportion.
- Moving an event's dates moves the hold on its paid transfers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMKwzThvcD1uQmnMcgJKHt
buzz.api.payouts gets, submits and refreshes a team's linked account on
the site's payout gateway, for the dashboard form that follows. Owners
only, since it decides where the team's money goes, and every owner is
emailed when the details change. Behind the new feature_payouts flag.
Business and bank details go through to the gateway and are never
stored or returned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMKwzThvcD1uQmnMcgJKHt
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Backend test coverage: 93%

Commit 1de42fc. Test modules are excluded.

Coverage by file
Name Stmts Miss Cover
buzz/__init__.py 5 5 0%
buzz/analytics.py 32 2 94%
buzz/api/account/__init__.py 32 2 94%
buzz/api/account/exceptions.py 8 0 100%
buzz/api/account/schemas.py 7 0 100%
buzz/api/account/services.py 15 1 93%
buzz/api/auth/__init__.py 11 0 100%
buzz/api/auth/schemas.py 3 0 100%
buzz/api/booking/__init__.py 61 2 97%
buzz/api/booking/coupons.py 37 0 100%
buzz/api/booking/details.py 102 6 94%
buzz/api/booking/downloads.py 51 0 100%
buzz/api/booking/event_data.py 69 6 91%
buzz/api/booking/exceptions.py 46 0 100%
buzz/api/booking/guests.py 80 10 88%
buzz/api/booking/holds.py 73 1 99%
buzz/api/booking/my_bookings.py 9 3 67%
buzz/api/booking/schemas.py 52 0 100%
buzz/api/booking/services.py 224 14 94%
buzz/api/campaigns/__init__.py 34 19 44%
buzz/api/campaigns/exceptions.py 11 0 100%
buzz/api/campaigns/schemas.py 2 0 100%
buzz/api/checkin/__init__.py 21 0 100%
buzz/api/checkin/exceptions.py 20 0 100%
buzz/api/checkin/schemas.py 12 0 100%
buzz/api/checkin/services.py 107 3 97%
buzz/api/comments/__init__.py 29 0 100%
buzz/api/comments/activity.py 66 1 98%
buzz/api/comments/email_content.py 90 1 99%
buzz/api/comments/exceptions.py 17 0 100%
buzz/api/comments/schemas.py 18 0 100%
buzz/api/comments/services.py 85 3 96%
buzz/api/communications/__init__.py 16 0 100%
buzz/api/communications/exceptions.py 11 0 100%
buzz/api/communications/schemas.py 6 0 100%
buzz/api/communications/services.py 64 1 98%
buzz/api/communities/__init__.py 62 1 98%
buzz/api/communities/creation.py 26 1 96%
buzz/api/communities/exceptions.py 19 0 100%
buzz/api/communities/notifications.py 34 2 94%
buzz/api/communities/queries.py 36 0 100%
buzz/api/communities/reviews.py 39 1 97%
buzz/api/communities/schemas.py 14 0 100%
buzz/api/communities/submissions.py 54 1 98%
buzz/api/events/__init__.py 52 0 100%
buzz/api/events/collaborators.py 100 4 96%
buzz/api/events/coupons.py 46 0 100%
buzz/api/events/exceptions.py 44 0 100%
buzz/api/events/guest_zones.py 48 0 100%
buzz/api/events/schemas.py 111 0 100%
buzz/api/events/services.py 241 11 95%
buzz/api/events/taxes.py 19 0 100%
buzz/api/events/ticket_types.py 52 0 100%
buzz/api/events/zoom.py 15 1 93%
buzz/api/exceptions.py 23 0 100%
buzz/api/filters/conditions.py 119 3 97%
buzz/api/filters/exceptions.py 5 0 100%
buzz/api/filters/schemas.py 6 0 100%
buzz/api/forms/__init__.py 29 0 100%
buzz/api/forms/answers.py 91 11 88%
buzz/api/forms/builder.py 21 1 95%
buzz/api/forms/conditions.py 36 1 97%
buzz/api/forms/exceptions.py 24 0 100%
buzz/api/forms/fields.py 64 3 95%
buzz/api/forms/schemas.py 18 0 100%
buzz/api/forms/services.py 139 7 95%
buzz/api/imports/__init__.py 13 0 100%
buzz/api/imports/exceptions.py 20 0 100%
buzz/api/imports/schemas.py 28 0 100%
buzz/api/imports/services.py 65 5 92%
buzz/api/imports/sponsors.py 165 2 99%
buzz/api/imports/spreadsheet.py 41 3 93%
buzz/api/listings/__init__.py 9 0 100%
buzz/api/listings/exceptions.py 4 0 100%
buzz/api/listings/schemas.py 7 0 100%
buzz/api/listings/services.py 33 0 100%
buzz/api/maps/__init__.py 20 0 100%
buzz/api/maps/exceptions.py 11 0 100%
buzz/api/maps/schemas.py 9 0 100%
buzz/api/maps/services.py 65 0 100%
buzz/api/notifications/__init__.py 12 0 100%
buzz/api/notifications/schemas.py 9 0 100%
buzz/api/notifications/services.py 47 0 100%
buzz/api/payments/__init__.py 17 1 94%
buzz/api/payments/currencies.py 7 2 71%
buzz/api/payments/schemas.py 3 0 100%
buzz/api/payouts/__init__.py 12 1 92%
buzz/api/payouts/exceptions.py 11 0 100%
buzz/api/payouts/schemas.py 2 0 100%
buzz/api/payouts/services.py 42 13 69%
buzz/api/playground/__init__.py 24 1 96%
buzz/api/playground/exceptions.py 9 0 100%
buzz/api/playground/schemas.py 6 0 100%
buzz/api/playground/services.py 91 5 95%
buzz/api/proposals/__init__.py 18 0 100%
buzz/api/proposals/exceptions.py 5 0 100%
buzz/api/proposals/schemas.py 27 0 100%
buzz/api/proposals/services.py 101 1 99%
buzz/api/schedule/__init__.py 13 4 69%
buzz/api/schedule/schemas.py 2 0 100%
buzz/api/schedule/services.py 29 12 59%
buzz/api/schemas.py 13 0 100%
buzz/api/search/__init__.py 9 0 100%
buzz/api/search/exceptions.py 5 0 100%
buzz/api/search/schemas.py 8 0 100%
buzz/api/search/services.py 54 0 100%
buzz/api/search/sources.py 29 0 100%
buzz/api/sponsorships/__init__.py 41 0 100%
buzz/api/sponsorships/enquiries.py 69 1 99%
buzz/api/sponsorships/exceptions.py 22 0 100%
buzz/api/sponsorships/forms.py 37 0 100%
buzz/api/sponsorships/manage.py 23 1 96%
buzz/api/sponsorships/schemas.py 21 0 100%
buzz/api/sponsorships/services.py 67 1 99%
buzz/api/sponsorships/sponsors.py 29 0 100%
buzz/api/tags/__init__.py 9 0 100%
buzz/api/tags/desk.py 35 9 74%
buzz/api/tags/exceptions.py 8 0 100%
buzz/api/tags/schemas.py 2 0 100%
buzz/api/tags/services.py 56 0 100%
buzz/api/teams/__init__.py 51 2 96%
buzz/api/teams/calendar.py 28 0 100%
buzz/api/teams/exceptions.py 29 0 100%
buzz/api/teams/invitations.py 34 0 100%
buzz/api/teams/public_page.py 32 8 75%
buzz/api/teams/schemas.py 14 0 100%
buzz/api/teams/services.py 108 1 99%
buzz/api/tickets/__init__.py 15 0 100%
buzz/api/tickets/emails.py 14 9 36%
buzz/api/tickets/exceptions.py 31 0 100%
buzz/api/tickets/schemas.py 4 0 100%
buzz/api/tickets/services.py 94 0 100%
buzz/api/tickets/windows.py 12 0 100%
buzz/booking_permissions.py 47 3 94%
buzz/buzz/doctype/buzz_custom_field/buzz_custom_field.py 7 0 100%
buzz/buzz/doctype/buzz_notification_subscription/buzz_notification_subscription.py 3 0 100%
buzz/buzz/web_form/apply_for_sponsorship/apply_for_sponsorship.py 3 3 0%
buzz/buzz/web_form/propose_a_talk/propose_a_talk.py 3 3 0%
buzz/buzz_marketing/doctype/buzz_campaign/buzz_campaign.py 21 7 67%
buzz/comments.py 90 4 96%
buzz/emails.py 27 0 100%
buzz/events/banner_pattern.py 35 0 100%
buzz/events/buzz_events_listing.py 60 11 82%
buzz/events/community_og_image.py 115 6 95%
buzz/events/countdown.py 13 0 100%
buzz/events/doctype/additional_event_page/additional_event_page.py 9 0 100%
buzz/events/doctype/buzz_event/buzz_event.py 263 17 94%
buzz/events/doctype/buzz_event_collaborator/buzz_event_collaborator.py 47 2 96%
buzz/events/doctype/buzz_form/buzz_form.py 118 10 92%
buzz/events/doctype/buzz_form/condition_validator.py 81 13 84%
buzz/events/doctype/buzz_form/form_types.py 128 2 98%
buzz/events/doctype/buzz_form_field/buzz_form_field.py 3 0 100%
buzz/events/doctype/buzz_price/buzz_price.py 10 0 100%
buzz/events/doctype/buzz_schedule/buzz_schedule.py 35 1 97%
buzz/events/doctype/buzz_schedule_item/buzz_schedule_item.py 57 4 93%
buzz/events/doctype/buzz_schedule_item_type/buzz_schedule_item_type.py 14 1 93%
buzz/events/doctype/buzz_schedule_track/buzz_schedule_track.py 14 1 93%
buzz/events/doctype/buzz_settings/buzz_settings.py 41 5 88%
buzz/events/doctype/buzz_tag/buzz_tag.py 30 2 93%
buzz/events/doctype/buzz_tag_link/buzz_tag_link.py 14 2 86%
buzz/events/doctype/buzz_team/buzz_team.py 106 3 97%
buzz/events/doctype/buzz_team/team_map.py 23 0 100%
buzz/events/doctype/buzz_team/team_page.py 140 4 97%
buzz/events/doctype/buzz_team_membership/buzz_team_membership.py 93 1 99%
buzz/events/doctype/buzz_team_settings/buzz_team_settings.py 45 0 100%
buzz/events/doctype/buzz_theme/buzz_theme.py 50 3 94%
buzz/events/doctype/buzz_theme/tokens.py 29 1 97%
buzz/events/doctype/buzz_theme_token/buzz_theme_token.py 3 0 100%
buzz/events/doctype/community_event_request/community_event_request.py 68 13 81%
buzz/events/doctype/event_category/event_category.py 9 0 100%
buzz/events/doctype/event_check_in/event_check_in.py 19 2 89%
buzz/events/doctype/event_check_in_zone/event_check_in_zone.py 40 0 100%
buzz/events/doctype/event_check_in_zone_ticket_type/event_check_in_zone_ticket_type.py 3 0 100%
buzz/events/doctype/event_cohost/event_cohost.py 4 0 100%
buzz/events/doctype/event_communication/event_communication.py 16 0 100%
buzz/events/doctype/event_external_link/event_external_link.py 4 0 100%
buzz/events/doctype/event_featured_speaker/event_featured_speaker.py 4 0 100%
buzz/events/doctype/event_feedback/event_feedback.py 4 0 100%
buzz/events/doctype/event_host/event_host.py 4 0 100%
buzz/events/doctype/event_payment_gateway/event_payment_gateway.py 4 0 100%
buzz/events/doctype/event_sponsor/event_sponsor.py 15 2 87%
buzz/events/doctype/event_talk/event_talk.py 8 0 100%
buzz/events/doctype/event_template/event_template.py 48 4 92%
buzz/events/doctype/event_template_add_on/event_template_add_on.py 4 0 100%
buzz/events/doctype/event_template_custom_field/event_template_custom_field.py 4 0 100%
buzz/events/doctype/event_template_ticket_category/event_template_ticket_category.py 4 0 100%
buzz/events/doctype/event_template_ticket_type/event_template_ticket_type.py 4 0 100%
buzz/events/doctype/event_topic/event_topic.py 18 5 72%
buzz/events/doctype/event_topic/topic_page.py 32 1 97%
buzz/events/doctype/event_topic_link/event_topic_link.py 3 0 100%
buzz/events/doctype/event_user_preferences/event_user_preferences.py 4 4 0%
buzz/events/doctype/event_venue/details.py 37 1 97%
buzz/events/doctype/event_venue/event_venue.py 97 1 99%
buzz/events/doctype/event_venue/geocode.py 72 9 88%
buzz/events/doctype/event_venue/map_image.py 58 0 100%
buzz/events/doctype/event_venue/map_link.py 106 5 95%
buzz/events/doctype/event_venue_location/event_venue_location.py 3 0 100%
buzz/events/doctype/offline_payment_method/offline_payment_method.py 11 0 100%
buzz/events/doctype/social_media_link/social_media_link.py 3 0 100%
buzz/events/doctype/speaker_profile/speaker_profile.py 8 0 100%
buzz/events/doctype/sponsorship_tier/sponsorship_tier.py 27 0 100%
buzz/events/doctype/talk_speaker/talk_speaker.py 3 0 100%
buzz/events/doctype/utm_parameter/utm_parameter.py 4 0 100%
buzz/events/form_og_image.py 13 0 100%
buzz/events/og_image.py 167 8 95%
buzz/events/og_text.py 66 1 98%
buzz/events/online_meeting.py 42 0 100%
buzz/events/report/event_attendance_summary/event_attendance_summary.py 65 32 51%
buzz/events/report/event_overview/event_overview.py 27 0 100%
buzz/events/team_mark.py 75 19 75%
buzz/hooks.py 40 0 100%
buzz/html_lines.py 66 1 98%
buzz/install.py 71 36 49%
buzz/integrations/zoom.py 3 3 0%
buzz/islands.py 9 1 89%
buzz/payments.py 66 13 80%
buzz/payouts.py 51 11 78%
buzz/permissions.py 214 14 93%
buzz/playground/__init__.py 32 9 72%
buzz/playground/checklist.py 68 45 34%
buzz/playground/cleanup.py 43 5 88%
buzz/playground/demo_data.py 108 3 97%
buzz/playground/demo_schedule.py 23 0 100%
buzz/playground/doctype/playground_email/playground_email.py 4 0 100%
buzz/playground/doctype/playground_sandbox/playground_sandbox.py 6 0 100%
buzz/playground/inbox.py 67 9 87%
buzz/proposals/description.py 68 0 100%
buzz/proposals/doctype/event_proposal/event_proposal.py 71 5 93%
buzz/proposals/doctype/proposal_speaker/proposal_speaker.py 4 0 100%
buzz/proposals/doctype/sponsorship_deck_item/sponsorship_deck_item.py 4 0 100%
buzz/proposals/doctype/sponsorship_enquiry/sponsorship_enquiry.py 85 5 94%
buzz/proposals/doctype/talk_proposal/talk_proposal.py 96 5 95%
buzz/proposals/doctype/talk_proposal_status/talk_proposal_status.py 4 0 100%
buzz/subscriptions.py 45 1 98%
buzz/tasks.py 4 4 0%
buzz/telemetry.py 46 0 100%
buzz/telemetry_scan.py 55 8 85%
buzz/ticketing/doctype/additional_field/additional_field.py 4 0 100%
buzz/ticketing/doctype/attendee_ticket_add_on/attendee_ticket_add_on.py 3 0 100%
buzz/ticketing/doctype/buzz_coupon_code/buzz_coupon_code.py 205 2 99%
buzz/ticketing/doctype/buzz_coupon_ticket_type/buzz_coupon_ticket_type.py 4 0 100%
buzz/ticketing/doctype/event_booking/booking_invoice.py 84 0 100%
buzz/ticketing/doctype/event_booking/event_booking.py 381 61 84%
buzz/ticketing/doctype/event_booking_attendee/event_booking_attendee.py 20 7 65%
buzz/ticketing/doctype/event_booking_refund/event_booking_refund.py 62 35 44%
buzz/ticketing/doctype/event_booking_refund_ticket/event_booking_refund_ticket.py 4 0 100%
buzz/ticketing/doctype/event_payment/event_payment.py 4 0 100%
buzz/ticketing/doctype/event_ticket/event_ticket.py 73 7 90%
buzz/ticketing/doctype/event_ticket_category/event_ticket_category.py 27 0 100%
buzz/ticketing/doctype/event_ticket_type/event_ticket_type.py 101 0 100%
buzz/ticketing/doctype/ticket_add_on/ticket_add_on.py 11 1 91%
buzz/ticketing/doctype/ticket_add_on_value/ticket_add_on_value.py 3 0 100%
buzz/ticketing/doctype/ticket_cancellation_item/ticket_cancellation_item.py 4 0 100%
buzz/ticketing/doctype/ticket_cancellation_request/ticket_cancellation_request.py 19 1 95%
buzz/ticketing/doctype/ticket_hold/ticket_hold.py 44 1 98%
buzz/ticketing/report/detailed_event_registrations/detailed_event_registrations.py 114 5 96%
buzz/ticketing/report/event_add_ons_overview/event_add_ons_overview.py 22 3 86%
buzz/uninstall.py 10 2 80%
buzz/utils.py 150 22 85%
buzz/www/community.py 24 0 100%
buzz/www/dashboard.py 43 4 91%
buzz/www/event/banner_color.py 20 6 70%
buzz/www/event/date_range.py 49 5 90%
buzz/www/event/dot_map.py 38 1 97%
buzz/www/event/index.py 142 6 96%
buzz/www/event/link_icons.py 1 0 100%
buzz/www/event/meta.py 64 5 92%
buzz/www/event/public_schedule.py 99 2 98%
buzz/www/event/registration.py 84 15 82%
buzz/www/event/schedule.py 11 0 100%
buzz/www/event/schedule_grid.py 55 2 96%
buzz/www/event/venue_map.py 35 1 97%
buzz/www/events.py 121 10 92%
buzz/www/events_sitemap.py 11 0 100%
buzz/www/site_header.py 41 1 98%
buzz/www/user_profile.py 36 0 100%
TOTAL 11653 809 93%

109 empty files skipped.

@harshtandiya harshtandiya changed the title docs(specs): plan team payouts through Razorpay Route feat(payments): pay teams their share through Route linked accounts Nov 7, 2026
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