Skip to content

General improvements for donations handling - #2154

Open
Oaphi wants to merge 7 commits into
developfrom
0valt/donations-fixes
Open

General improvements for donations handling#2154
Oaphi wants to merge 7 commits into
developfrom
0valt/donations-fixes

Conversation

@Oaphi

@Oaphi Oaphi commented Sep 6, 2026

Copy link
Copy Markdown
Member
  • :intent with :amount less than 0.5 no longer causes a runtime error due to a typo in a local variable name (@symbol);
  • return_to parameter is now dropped unless it's an HTTP, HTTP(S), or relative URI (security);
  • :intent and :success have tests now;

If you want to test donations manually, you'll only need an API key for a sandbox.

Do not merge unless at least one requested reviewer manually confirms that the full flow works.

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.84%. Comparing base (612ac9b) to head (2295bc2).

Files with missing lines Patch % Lines
app/controllers/donations_controller.rb 64.70% 12 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
controllers 77.80% <64.70%> (+0.77%) ⬆️
helpers 85.58% <100.00%> (+0.10%) ⬆️
jobs 79.93% <ø> (ø)
models 93.48% <ø> (ø)
tasks 61.11% <ø> (ø)
scripts ∅ <ø> (∅)

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oaphi
Oaphi force-pushed the 0valt/donations-fixes branch from 4fdf062 to f54c326 Compare September 6, 2026 00:51
@Oaphi
Oaphi requested review from ArtOfCode- and cellio September 6, 2026 02:32
@Oaphi Oaphi mentioned this pull request Sep 6, 2026
2 tasks

@cellio cellio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I set up a Stripe sandbox. Donations above the minimum go through (correct UI for us, shows up in Stripe, sends email). Donations below the minimum are caught in the form so they're never submitted. I don't yet know what we do with webhooks or how to test that.


if amount < 0.50
flash[:danger] = "Sorry, we can't accept amounts below #{symbol}0.50. We appreciate your generosity, but the " \
flash[:danger] = "Sorry, we can't accept amounts below #{@symbol}0.50. We appreciate your generosity, but the " \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't been able to trigger this message; an amount below 0.5 gets intercepted in the view with a message that just says "can't be below 0.5" without the explanation. This PR doesn't change that behavior, but I just wanted to note that in case it's testing error on my part and I should be able to make this show up.

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