-
Notifications
You must be signed in to change notification settings - Fork 125
[PAY-2112] Don't attempt to use balance if total amount due drops below minimum #6550
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
Conversation
| if (diff > 0 && diff >= minPurchaseAmountCents) { | ||
| amountDue = diff | ||
| existingBalance = balanceBN.div(BN_USDC_CENT_WEI).toNumber() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: would be cool if we could use getBalancedNeeded here instead of rewriting the same logic, but nbd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but didn't want to mess with it too much since they return slightly different shapes of objects.
|
Preview this change https://demo.audius.co/pay-2112-min-balance |
[f630ef2] [C-3313 C-3178] Add typography docs, Update Text (#6580) Dylan Jeffers [63c6fdc] [C-3177] Add shadow foundations doc (#6582) Dylan Jeffers [94b82cd] [C-3179] Add corner-radius foundations doc (#6583) Dylan Jeffers [b8d3a0f] [C-3180] Add spacing fondations doc (#6584) Dylan Jeffers [f494196] Add PasswordInput and HarmonyPasswordField C-3298 (#6578) nicoback2 [69f6e49] [Sign up] Put password and email pages into PageWithAudiusValues, create generic LeftContentContainer, add back button (#6566) nicoback2 [563dc0b] Update Paper default background (#6581) Dylan Jeffers [50ff676] [C-3151 C-3314] Add color foundation docs (#6573) Dylan Jeffers [0c7593f] [C-3258] Add Harmony Paper component and docs (#6556) Andrew Mendelsohn [81f0e8c] [PROTO-1386] Fix multiple sla-auditors in health check (#6557) Theo Ilie [9991e7c] [PAY-2122] Gate embeds for premium content (#6577) Raymond Jacobson [d23f244] [C-3219] Fix suggested follow popup (web) (#6529) Andrew Mendelsohn [95b8948] [PAY-2121] Don't skip previews in lineups (#6575) Reed [ee7528a] Bump version to 0.5.9 audius-infra [eac762b] [PAY-1976] Use receiver root wallet instead of ATA (#6574) Saliou Diallo [7b95045] Fix AudioPlayer missing src bug (#6572) Reed [613b7c8] [PROTO-1393] Fix mediorum using dev build without git SHA (#6571) Theo Ilie [051c20c] [C-3311] Fix validation icons in sign-in (#6570) Dylan Jeffers [0a83c34] [C-3210] Update a few internal harmony components and SelectablePill to use emotion (#6569) Kyle Shanks [65492a2] Lockfile update for pinning react-qrcode (#6568) Randy Schott [95a0051] Fix desktop deploy (#6535) Raymond Jacobson [c30dfb0] Fix balance formatting for usdc withdrawal events (#6565) Randy Schott [6cb2a37] Bump version to 0.5.8 audius-infra [d6b5fee] [C-3307] Fix track count check for collections sagas (#6553) Kyle Shanks [05a996f] Fix zindex of 10000s modals (#6563) Raymond Jacobson [8c48a95] Fix locked-status-badge text color (#6562) Dylan Jeffers [da10685] Fix USDC Manual Transfer Drawer layering (#6561) Marcus Pasell [91440d9] Bump to version 1.5.49 (#6560) Raymond Jacobson [bbadcdf] Update the drawer fix to not render on start (#6558) Marcus Pasell [c6fed0a] Fix lint (#6559) Raymond Jacobson [453201e] [PAY-2120] Add user dashboard (#6547) Raymond Jacobson [1bdb0c7] [C-3302] Migrate Icon to emotion (#6555) Dylan Jeffers [f4e89ab] [C-3303] Add harmony-theme-provider to web (#6554) Dylan Jeffers [eaba2e6] [C-3300 C-3301] Improve organization, use emotion in storybook (#6532) Dylan Jeffers [aa54213] Fix challenge new pill on android (#6552) Reed [6617985] [C-3308] Enable common tests (#6549) Dylan Jeffers [c1fd487] [PAY-2112] Don't attempt to use balance if total amount due drops below minimum (#6550) Randy Schott [d5c964b] [PAY-2031][PAY-2081] Fix coming soon message and reward padding (#6551) Saliou Diallo [f798b1e] PAY-2119: Fix Stripe Drawer zIndex on Android (#6546) Marcus Pasell [71e63ac] [PAY-2114] Show country is not supported message for purchases (#6542) Reed [f8d5ec5] [PAY-2116][PAY-2117] Re-enable form elements on USDC purchase error (#6548) Saliou Diallo [c7d458b] [C-3304] Update Button styles to work on desktop and older chrome versions (#6544) Kyle Shanks [ccfa0da] Fixes lint and typecheck (#6545) Dylan Jeffers [fb1b48c] [PAY-2109][PAY-2113] Miscellaneous gated track fixes (#6543) Saliou Diallo [f6dab03] Add end-of-lineup notice to premium tracks lineup (#6541) Dylan Jeffers [a514d74] Add teamId to mac dist notarize (#6534) Dylan Jeffers [af90f1d] [PAY-2115] Remove favorite btn when not purchased (#6540) Raymond Jacobson [039fad9] Fix manual transfer on android (#6539) Reed [65345f3] Fix desktop commands (#6538) Sebastian Klingler [1660bbc] Fix USDC manual transfer icon color (#6537) Reed [0b946f6] Bump version to 0.5.7 audius-infra [0b348d8] Enable scroll on StripeOnrampEmbed (#6536) Dylan Jeffers [9876a51] [PAY-2094] Update TOS (#6531) Raymond Jacobson [baa9363] [PAY-1880] Re-enable email summary notifs for purchases (#6475) Raymond Jacobson [aa0bfde] [C-3286] Finalize harmony button docs (#6528) Dylan Jeffers [fc9f4f8] Hotfix Content Node view width and lint for CI (#6530) Theo Ilie [1f65f39] [PAY-2086] Update TOS banner (#6527) Raymond Jacobson [670016a] [C-3227] Add emotion and theme to web and mobile (#6518) Dylan Jeffers [740b6e0] [PAY-2070] Fix dashboard filter (#6526) Raymond Jacobson [980f937] Bump mobile versions (#6524) Raymond Jacobson [adcebb7] Remove circular dep (#6525) Marcus Pasell [7fdc652] Fix margin (#6523) Saliou Diallo [a695fa5] Buy Crypto via SOL Fixes (#6517) Marcus Pasell [6a9f558] Various small USDC UI fixes (#6522) Reed [cf6e69c] Fix protocol dashboard bugs (#6521) Theo Ilie [5ea43b8] [PAY-2102] Fix locked content modal not opening regression bug (#6516) Saliou Diallo [825d7d2] Uncomment lines to apply v2 landing page (#6520) Saliou Diallo [2ae80e7] [PAY-2095] Analytics for USDC manual transfer (#6519) Reed [55719e3] [PAY-2105]Add opt-in tracking for modal open/close events (#6514) Randy Schott [50882b9] Add per service charts to protocol-dashboard (#6423) Michelle Brier [cd388c1] [PAY-2101] Cancel balance polling on purchase start (#6515) Reed [50e311f] Fix manual transfer UI on mobile web (#6512) Reed [5fc93aa] [PAY-2100] Hide manual transfer UI while purchase in progress (#6511) Reed [2956d58] Implement create password page - web C-3262 (#6443) nicoback2 [2ebd87c] [PAY-2093] USDC manual transfer web UI (#6507) Reed [d259dae] Add redux persist to web; use for library categories C-3125 C-3220 (#6354) nicoback2 [5aa48d0] [PAY-1984] More landing page updates (#6508) Saliou Diallo [44235cf] Bump version to 0.5.6 audius-infra [7ffdeac] Bump mobile versions (#6509) Raymond Jacobson [35ab00d] Add retries to Buy Crypto via SOL flow (#6503) Marcus Pasell [7f90f8e] [C-3275] Welcome doc and Component doc template (#6499) Dylan Jeffers [e944fd7] Fix remix access bug (#6506) Saliou Diallo [51de866] [PAY-2088] Hide play counts on premium on mobile (#6505) Raymond Jacobson [97e4bc6] [PAY-2044] Add Stripe taking a while toast (#6492) Raymond Jacobson [979d3a9] Redirect root with hash routing (#6502) Theo Ilie [1eb740c] [PROTO-1373] Introduce arm machine type to ci runner bootstrap script (#6500) Danny [2ce4aad] [PAY-1987] Remove check for audio matching challenges in non-prod envs (#6501) Reed [3bea782] Buy Crypto via SOL (#6496) Marcus Pasell [db79330] [C-3284 C-3285] Improve harmony icons and build (#6495) Dylan Jeffers [09ddbda] [PAY-2017] Adds analytics for withdraw flow (#6497) Randy Schott [9c6fe35] [PROTO-1210]: better transcode failure handling. (#6498) Steve Perkins [471ccf7] [PAY-2019][PAY-2080][PAY-2056] Fix miscellaneous USDC upload validation bugs (#6431) Saliou Diallo [99b5cd1] Bump version to 0.5.5 audius-infra [24af5d5] [C-3277] Add harmony theming (#6483) Dylan Jeffers
Description
Our payment onramp has a minimum purchase amount. There are situation where users end up with a small balance that would make them unable to complete checkout. In those situations, we will not attempt to use the balance.
This does introduce some corner cases where you have a larger balance and the math of (price+extraAmount-balance) works out to less than the minimum and forces you to pay the full price or bump up your pay extra amount. But those should be more rare than the current issue and we can land changes later to make it a little more sophisticated.
Fixes PAY-2112
How Has This Been Tested?
Tested locally in browser and iOS simulator against staging
Note I temporarily baseed this on #6549 to get Jest working and ensure my tests pass. But I don't want to necessarily block this PR on that one, so the tests won't run in this branch as-is. They will, however, be part of verification for future changes once that other PR is merged.