-
Notifications
You must be signed in to change notification settings - Fork 942
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
Payment Intents #1089
Merged
Merged
Payment Intents #1089
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
OtterleyW
force-pushed
the
payment-intents
branch
3 times, most recently
from
May 21, 2019 13:58
d0ae3db
to
df57557
Compare
Gnito
force-pushed
the
payment-intents
branch
3 times, most recently
from
May 24, 2019 15:17
da7d3b9
to
e41f86a
Compare
OtterleyW
force-pushed
the
payment-intents
branch
from
June 11, 2019 10:53
e41f86a
to
e0bb4f8
Compare
Gnito
force-pushed
the
payment-intents
branch
8 times, most recently
from
June 19, 2019 13:36
9db6ca8
to
b3ef9b6
Compare
Gnito
force-pushed
the
payment-intents
branch
3 times, most recently
from
June 19, 2019 15:26
436e090
to
75eac0b
Compare
Gnito
force-pushed
the
payment-intents
branch
2 times, most recently
from
June 24, 2019 15:59
82229e7
to
4ba8084
Compare
Gnito
force-pushed
the
payment-intents
branch
3 times, most recently
from
June 26, 2019 09:56
4f69d97
to
fa35f89
Compare
and remove unused createStripePaymentToken
(Redirect tx with payment-pending to checkout page and clear card paymenterrors from store.)
…action. Data serialization is improved too: Date and Decimal objects within data are serialized automatically
Combine initiateOrder and initiateOrderAfterEnquiry thunk functions Use PaymentIntents flow: initiateOrder (SDK), handleCardPayment(Stripe), confirmPayment (SDK), sendMessage (SDK)
Form is not visible after handleCardPayment is called. Show errors on various steps of PaymentIntent (SCA) process.
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.
Read more about this change:
Before deploying this SCA change into production, you should test with live credit cards how the authentication modal works with most common card issuers in your marketplace.
Automatic payment confirmation flow with Stripe.js (using
stripe.handleCardPayment
) handles all the different authentication methods (created by card issuers) within an iframe modal. However, some card issuer's might have flows that don't easily fit into this setup. Especially what comes to 3D Secure version 1.Read more about 3D Secure 2 flow and its frictionless fallback to version 1: https://stripe.com/gb/guides/3d-secure-2
If there are problems with authentication modal, you might want to check how to customize that iframe: https://stripe.com/docs/payments/3d-secure-iframe
CheckoutPage flow has been changed to support Stripe's PaymentIntents
After form submit, there are 4 Promises in sequence:
=> sdk.transactions.initiate({ transition: 'transition/request-payment', ...})
stripePaymentIntentClientSecret
inside transaction's protectedData.'transition/confirm-payment'
before that.=> stripe.handleCardPayment(stripePaymentIntentClientSecret, card, paymentParams)
Some payments might need Strong Customer Authentication (SCA). In practice, Stripe's script creates a popup (iframe) to card issuers site, where 3D secure v2 authentication flow can be completed.
=> sdk.transactions.transition({ transition: 'transition/confirm-payment', ...})
=>sdk.messages.send({ transactionId: orderId, content: message })
Note: if the checkout page is refreshed in the middle of the process, we continue the flow from where it was left. Because of that we also need to retrieve PaymentIntent from Stripe as part of data that needs to be loaded.
Read more from Flex Docs: https://www.sharetribe.com/docs/guides/how-to-take-payment-intents-into-use/
PaymentIntent flow with screenshots
PaymentIntents form with billing details:
(Note: billing address is recommended by Stripe, but it can be removed easily from StripePaymentForm)
3DS2 test popup:
Error cases
Payment expired. (Customer spent too much time between request-payment and confirm-payment transitions):
Customer fails payment authentication popup somehow (possibilities for failure depends on banks site). Customer can try again, but sees an error:
Customer fails confirm-payment API call (this was a network error):
Page refresh made between payment transitions, retrieving PaymentIntent from stripe.duck.js fails (this was a network error):