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

Merged
merged 7 commits into from
Jan 10, 2025

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.1 MB

ℹ️ View Unchanged
Filename Size
./public/compiled-assets/javascripts/[countryGroupId]/events/router.js 90.4 kB
./public/compiled-assets/javascripts/[countryGroupId]/router.js 259 kB
./public/compiled-assets/javascripts/ausMomentMap.js 108 kB
./public/compiled-assets/javascripts/contributionsRedirectStyles.js 20 B
./public/compiled-assets/javascripts/digitalSubscriptionLandingPage.js 228 kB
./public/compiled-assets/javascripts/downForMaintenancePage.js 67.7 kB
./public/compiled-assets/javascripts/error404Page.js 67.6 kB
./public/compiled-assets/javascripts/error500Page.js 67.5 kB
./public/compiled-assets/javascripts/favicons.js 617 B
./public/compiled-assets/javascripts/paperSubscriptionCheckoutPage.js 166 kB
./public/compiled-assets/javascripts/paperSubscriptionLandingPage.js 87.9 kB
./public/compiled-assets/javascripts/payPalErrorPage.js 66.1 kB
./public/compiled-assets/javascripts/payPalErrorPageStyles.js 20 B
./public/compiled-assets/javascripts/promotionTerms.js 73.8 kB
./public/compiled-assets/javascripts/subscriptionsLandingPage.js 73.2 kB
./public/compiled-assets/javascripts/subscriptionsRedemptionPage.js 118 kB
./public/compiled-assets/javascripts/supporterPlusLandingPage.js 225 kB
./public/compiled-assets/javascripts/unsupportedBrowserStyles.js 20 B
./public/compiled-assets/javascripts/weeklySubscriptionCheckoutPage.js 163 kB
./public/compiled-assets/javascripts/weeklySubscriptionLandingPage.js 88.1 kB
./public/compiled-assets/webpack/136.js 2.17 kB
./public/compiled-assets/webpack/187.js 21.7 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
Copy link
Contributor

@andrewHEguardian andrewHEguardian left a comment

Choose a reason for hiding this comment

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

Nice 👍

@tjmw tjmw force-pushed the tw/server-side-one-time-validation branch from 0de4811 to 31b5526 Compare January 10, 2025 09:25
@tjmw tjmw merged commit ff416fa into main Jan 10, 2025
19 checks passed
@tjmw tjmw deleted the tw/server-side-one-time-validation branch January 10, 2025 09:52
@prout-bot
Copy link

Seen on PROD (merged by @tjmw 8 minutes and 52 seconds ago)

Sentry Release: support-client-side, support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants