This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 220
Improve Stripe (chrome pay) express payment method availability #3424
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size Change: +11.9 kB (1%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
budzanowski
reviewed
Nov 19, 2020
), | ||
paymentRequestAvailable( { | ||
currencyCode: cartData?.cartTotals?.currency_code?.toLowerCase(), | ||
totalPrice: parseInt( cartData?.cartTotals?.total_price, 10 ), |
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.
Since we get total_price
using the optional chaining operator we assume that we can get undefined
as a result. Undefined passed to parseInt
will get us NaN
. When we plug the NaN
to the test used on line 26 if ( totalPrice < 30 )
we get False
and continue but we should stop.
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.
Good catch. I committed a fallback to || 0
.
budzanowski
approved these changes
Nov 19, 2020
github-actions
bot
added
status: ready to merge
and removed
status: needs review
labels
Nov 19, 2020
nerrad
added
category: extensibility
Work involving adding or updating extensibility. Useful to combine with other scopes impacted.
type: bug
The issue/PR concerns a confirmed bug.
block: checkout
Issues related to the checkout block.
labels
Nov 23, 2020
7 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: checkout
Issues related to the checkout block.
category: extensibility
Work involving adding or updating extensibility. Useful to combine with other scopes impacted.
type: bug
The issue/PR concerns a confirmed bug.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will hide/show Stripe in the cart/checkout Express Payment area based on the value of the cart. Transactions lower than 0.30 cents are blocked.
This required a fix to the
SET_REGISTERED_EXPRESS_PAYMENT_METHODS
reducer becaused it merged, rather than replaced, available payment methods.Fixes #3402
How to test the changes in this Pull Request:
Changelog