Skip to content

Monthly Giving: Leave Slipflow's monthly gifts to Slipflow - #1482

Merged
caseyhelbling merged 3 commits into
supporter_level_goalfrom
clh/slipflow-recurring-copy
Nov 25, 2026
Merged

caseyhelbling merged 3 commits into
supporter_level_goalfrom
clh/slipflow-recurring-copy

Conversation

@caseyhelbling

Copy link
Copy Markdown
Collaborator

Part of CommitChange/tix#4799. Slipflow charges monthly gifts from its stripe_recurrences and writes a recurring donation as a copy, so receipts, the dashboard and reports keep working. CC owns the cancel and nothing else.

Deploy this before the Slipflow PR that writes the copy. Until then CC's charger would treat those rows as its own.

  • A recurring donation is Slipflow's when a charge on its donation started a stripe_recurrence (RecurringDonation.slipflow). No new column.
  • CC's charger skips any donation with a Slipflow charge, in _all_that_are_due and in PayRecurringDonation.with_stripe, forced runs included.
  • Refused for Slipflow's: new card, amount or paydate (donor page), staff edits including end date, holds, and convert_donation_to_recurring_donation for any Slipflow-charged donation.
  • Donor page: cancel, address, one-time gift, and "cancel this donation and give again" to change it. Staff panel: no edit button. Receipt and failure emails: cancel wording.
  • stripe_recurrences.stopped_at / stop_reason for Slipflow's own stops (three declines in a row, refunded or disputed first payment). Slipflow sets n_failures = 3 once when it stops, so CC shows the gift as failed.

Every CC path that sets n_failures on these rows is refused or skipped: update_card_id, update_amount and staff update are refused, the charger's success and failure updates never run, and insert_recurring_donation can't run on these donations because convert is refused. fail_a_recurring_donation only sets 3, and nothing calls it.

Not covered, since Slipflow writes the row without CC's callbacks: RecurringDonationCreatedJob doesn't fire on Slipflow's copy. The cancel callbacks still fire, since cancels go through CC's cancel!.

Also fixes the super admin recurring donations without cards report, which raised a missing FROM-clause error on main.

Tested with rspec in a local container: the full suite, plus new specs for the marker, the charger, each refusal, the donor and staff controllers, and the emails.

Slipflow charges monthly gifts itself and will write a recurring donation as a copy for CC's display, receipts and reports. CC keeps the cancel and leaves the rest alone.

A recurring donation is Slipflow's when a charge on its donation started a stripe_recurrence. CC's charger skips any donation with a Slipflow charge, in the daily due query and in a forced run, so the order Slipflow's rows become visible in doesn't matter.

CC refuses a new card, amount or paydate, staff edits, holds, and converting a Slipflow-charged donation to recurring. The donor page offers cancel, address and a one-time gift, with a line to cancel and give again to change the gift. The staff panel hides the edit button. The receipt and the failure emails point to the cancel.

stripe_recurrences gets stopped_at and stop_reason for the gifts Slipflow stops on its own: three declines in a row, or a refunded or disputed first payment.

The recurring donations without cards report now joins cards. It raised a missing FROM-clause error before.
Comment thread app/models/recurring_donation_hold.rb Resolved

@aliyahmoore aliyahmoore left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me! Looks like there are a few follow-ups this leaves for Slipflow and just wanted to note them here:

  • Writing CC's copy when a gift starts: #522 (tix#4799)
  • Skipping gifts cancelled in CC when charging: tix#4799
  • Stopping after three declines in a row: tix#4798
  • Stopping when the first payment was refunded or disputed: tix#4745
  • Saving stopped_at and stop_reason, and setting n_failures to 3 when a gift stops: doesn't look like it's on a ticket yet.
  • Email lists not updating since RecurringDonationCreatedJob doesn't run for the copy: doesn't look like it has a ticket.

Happy to create tickets for the last two if needed.

@caseyhelbling
caseyhelbling merged commit cdb3648 into supporter_level_goal Nov 25, 2026
5 checks passed
@caseyhelbling
caseyhelbling deleted the clh/slipflow-recurring-copy branch November 25, 2026 22:05
@caseyhelbling

Copy link
Copy Markdown
Collaborator Author

Seems good to me! Looks like there are a few follow-ups this leaves for Slipflow and just wanted to note them here:

  • Writing CC's copy when a gift starts: Bump nokogiri from 1.13.9 to 1.13.10 #522 (tix#4799)
  • Skipping gifts cancelled in CC when charging: tix#4799
  • Stopping after three declines in a row: tix#4798
  • Stopping when the first payment was refunded or disputed: tix#4745
  • Saving stopped_at and stop_reason, and setting n_failures to 3 when a gift stops: doesn't look like it's on a ticket yet.
  • Email lists not updating since RecurringDonationCreatedJob doesn't run for the copy: doesn't look like it has a ticket.

Happy to create tickets for the last two if needed.

Yep - good list. Most of these are already accounted for in tickets/prs.

  1. CC copy is the slipflow PR 522.
  2. skipping gifts - yes 4799
  3. stopping after 3 declines 4745 (rule 11) - 4798 are the emails for declines.
  4. stopped_at/stop_reason, etc. Probably should be part of 4799 - I'll add a bullet to that list.
  5. email lists -- Gap - I filed a ticket for it.

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