Refactor Stripe V3 Intents, Elements and cart checkout JS code#31
Merged
Merged
Conversation
5fe06c9 to
64d1c73
Compare
64d1c73 to
e5b0015
Compare
The code has been encapsulated in proper constructor objects by separating common code as necessary. Code shared among all the Stripe V3 API checkout procedures is now contained in the `Spree.StripePayment` constructor. `SolidusStripe.Elements` inherits directly from `SolidusStripe.Payment`, same goes for `SolidusStripe.CartPageCheckout`. `SolidusStripe.PaymentIntents` inherits from `SolidusStripe.Elements`, as it basically extends the Elements functionality by adding the 3D secure feature. Both `SolidusStripe.CartPageCheckout` and `SolidusStripe.PaymentIntents` allow to pay with Apple Pay/Google Pay, so they include shared methods from `PaymentRequestButtonShared`. All functions are defined on the different classes prototype, this will allow to easily customize those functions according to needs by just overriding them on the proper prototype object.
a6d87e4 to
7c161ce
Compare
Since solidusio/solidus#3524 was merged, we need to verify if we're using the single "Name" field or the previous first/last name combination.
7c161ce to
cf68be3
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The code has been encapsulated in proper constructor objects by separating common code as necessary.
Code shared among all the Stripe V3 API checkout procedures is now contained in the
Spree.StripePaymentconstructor.SolidusStripe.Elementsinherits directly fromSolidusStripe.Payment, same goes forSolidusStripe.CartPageCheckout.SolidusStripe.PaymentIntentsinherits fromSolidusStripe.Elements, as it basically extends the Elements functionality by adding the 3D secure feature.Both
SolidusStripe.CartPageCheckoutandSolidusStripe.PaymentIntentsallow to pay with Apple Pay/Google Pay, so they include shared methods fromPaymentRequestButtonShared.All functions are defined on the different classes prototype, this will allow to easily customize those functions according to needs by just overriding them on the proper prototype object.