Skip to content
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

Add min amount validation to server side one time payments #6665

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tjmw
Copy link
Member

@tjmw tjmw commented Dec 30, 2024

What are you doing in this PR?

Add min amount validation to the payment API for one time contributions.

Trello Card

Why are you doing this?

We already have client side validation for this, but we'd like to enforce server side too as this makes us more robust.

How to test

I've tested this in CODE. In order to do this I had to temporarily remove the client side validation. The error message we show in this case is quite generic, but I think in general we don't expect users to hit this as the client side validation should kick in before the request even makes it to the backend.

Stripe:
Screenshot 2025-01-06 at 13 49 26

PayPal:
Screenshot 2025-01-06 at 13 50 21

If we need to, perhaps we could follow up with a more contextual error message in another PR.

How can we measure success?

Have we considered potential risks?

Accessibility test checklist

Screenshots

Copy link
Contributor

github-actions bot commented Dec 30, 2024

Size Change: 0 B

Total Size: 2.24 MB

ℹ️ View Unchanged
Filename Size
./public/compiled-assets/javascripts/[countryGroupId]/events/router.js 90.1 kB
./public/compiled-assets/javascripts/[countryGroupId]/router.js 267 kB
./public/compiled-assets/javascripts/ausMomentMap.js 108 kB
./public/compiled-assets/javascripts/contributionsRedirectStyles.js 20 B
./public/compiled-assets/javascripts/digitalSubscriptionLandingPage.js 237 kB
./public/compiled-assets/javascripts/downForMaintenancePage.js 70.7 kB
./public/compiled-assets/javascripts/error404Page.js 70.7 kB
./public/compiled-assets/javascripts/error500Page.js 70.6 kB
./public/compiled-assets/javascripts/favicons.js 617 B
./public/compiled-assets/javascripts/paperSubscriptionCheckoutPage.js 175 kB
./public/compiled-assets/javascripts/paperSubscriptionLandingPage.js 87.5 kB
./public/compiled-assets/javascripts/payPalErrorPage.js 69 kB
./public/compiled-assets/javascripts/payPalErrorPageStyles.js 20 B
./public/compiled-assets/javascripts/promotionTerms.js 73.6 kB
./public/compiled-assets/javascripts/subscriptionsLandingPage.js 72.9 kB
./public/compiled-assets/javascripts/subscriptionsRedemptionPage.js 127 kB
./public/compiled-assets/javascripts/supporterPlusLandingPage.js 308 kB
./public/compiled-assets/javascripts/unsupportedBrowserStyles.js 20 B
./public/compiled-assets/javascripts/weeklySubscriptionCheckoutPage.js 172 kB
./public/compiled-assets/javascripts/weeklySubscriptionLandingPage.js 87.7 kB
./public/compiled-assets/webpack/136.js 2.17 kB
./public/compiled-assets/webpack/187.js 21.6 kB
./public/compiled-assets/webpack/344.js 2.01 kB
./public/compiled-assets/webpack/643.js 22.4 kB
./public/compiled-assets/webpack/706.js 107 kB

compressed-size-action

@tjmw tjmw force-pushed the tw/server-side-one-time-validation branch from a76f2db to 0de4811 Compare January 6, 2025 13:52
@tjmw tjmw marked this pull request as ready for review January 6, 2025 13:55
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.

1 participant