General improvements for donations handling - #2154
Conversation
Only triggers for donations less than 0.5
Only HTTP, HTTP(S), or relative URIs are allowed
Codecov Report❌ Patch coverage is
Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4fdf062 to
f54c326
Compare
JSON formatting only for now
cellio
left a comment
There was a problem hiding this comment.
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 " \ |
There was a problem hiding this comment.
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.
:intentwith:amountless than 0.5 no longer causes a runtime error due to a typo in a local variable name (@symbol);return_toparameter is now dropped unless it's an HTTP, HTTP(S), or relative URI (security);:intentand:successhave 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.