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

One-time checkout: prevent large other amount causing error #6685

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

andrewHEguardian
Copy link
Contributor

What are you doing in this PR?

Add a max amount check to the 'Other' amount in one time checkout. If it is above the maximum - it does not go into the finalAmount variable where it can be used to set the amount in the rest of the page. This stops it reaching Stripe's JS where it could be above the maximum.

Trello Card

How to test

Type in a very large number in the other amount, the amount is not listed in the payment button and does not crash the page.

Screenshots

Before:
(Above our max)
image

(Above Stripe's max)
image

After:
image

@andrewHEguardian andrewHEguardian requested a review from tjmw January 10, 2025 16:13
Copy link
Contributor

Size Change: +7 B (0%)

Total Size: 2.1 MB

ℹ️ View Unchanged
Filename Size Change
./public/compiled-assets/javascripts/[countryGroupId]/events/router.js 90.4 kB 0 B
./public/compiled-assets/javascripts/[countryGroupId]/router.js 259 kB +7 B (0%)
./public/compiled-assets/javascripts/ausMomentMap.js 108 kB 0 B
./public/compiled-assets/javascripts/contributionsRedirectStyles.js 20 B 0 B
./public/compiled-assets/javascripts/digitalSubscriptionLandingPage.js 228 kB 0 B
./public/compiled-assets/javascripts/downForMaintenancePage.js 67.7 kB 0 B
./public/compiled-assets/javascripts/error404Page.js 67.6 kB 0 B
./public/compiled-assets/javascripts/error500Page.js 67.5 kB 0 B
./public/compiled-assets/javascripts/favicons.js 617 B 0 B
./public/compiled-assets/javascripts/paperSubscriptionCheckoutPage.js 166 kB 0 B
./public/compiled-assets/javascripts/paperSubscriptionLandingPage.js 87.9 kB 0 B
./public/compiled-assets/javascripts/payPalErrorPage.js 66.1 kB 0 B
./public/compiled-assets/javascripts/payPalErrorPageStyles.js 20 B 0 B
./public/compiled-assets/javascripts/promotionTerms.js 73.8 kB 0 B
./public/compiled-assets/javascripts/subscriptionsLandingPage.js 73.2 kB 0 B
./public/compiled-assets/javascripts/subscriptionsRedemptionPage.js 118 kB 0 B
./public/compiled-assets/javascripts/supporterPlusLandingPage.js 225 kB 0 B
./public/compiled-assets/javascripts/unsupportedBrowserStyles.js 20 B 0 B
./public/compiled-assets/javascripts/weeklySubscriptionCheckoutPage.js 163 kB 0 B
./public/compiled-assets/javascripts/weeklySubscriptionLandingPage.js 88.1 kB 0 B
./public/compiled-assets/webpack/136.js 2.17 kB 0 B
./public/compiled-assets/webpack/187.js 21.7 kB 0 B
./public/compiled-assets/webpack/344.js 2.01 kB 0 B
./public/compiled-assets/webpack/643.js 22.4 kB 0 B
./public/compiled-assets/webpack/706.js 107 kB 0 B

compressed-size-action

Copy link
Member

@tjmw tjmw left a comment

Choose a reason for hiding this comment

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

Nice, this looks great 👍

@andrewHEguardian andrewHEguardian merged commit 5ed01ed into main Jan 13, 2025
19 checks passed
@andrewHEguardian andrewHEguardian deleted the ahe/prevent-large-amount branch January 13, 2025 10:51
@prout-bot
Copy link

Seen on PROD (merged by @andrewHEguardian 9 minutes and 57 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