-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Handle additional confirmation in checkout complete flow #5179
Conversation
ea229f3
to
70025f1
Compare
Codecov Report
@@ Coverage Diff @@
## master #5179 +/- ##
==========================================
+ Coverage 91.8% 91.81% +<.01%
==========================================
Files 270 272 +2
Lines 17554 17708 +154
Branches 1526 1533 +7
==========================================
+ Hits 16116 16258 +142
- Misses 1040 1050 +10
- Partials 398 400 +2
Continue to review full report at Codecov.
|
Here is the report for 8ab156a (mirumee/saleor @ add-confirmation-to-checkout-complete) No differences were found. (click me)
# api.benchmark checkout
test name left count right count duplicate count
------------------------------------------- ----------- ----------- ---------------
add billing address to checkout 34 34 20
add shipping to checkout 7 7 0
checkout payment charge 10 10 0
complete checkout 8 8 0
create checkout 5 5 1
# api.benchmark homepage
test name left count right count duplicate count
------------------------------------------- ----------- ----------- ---------------
retrieve main menu 5 5 0
retrieve product list 4 4 0
retrieve secondary menu 5 5 0
retrieve shop 2 2 0
# api.benchmark product
test name left count right count duplicate count
------------------------------------------- ----------- ----------- ---------------
product details 18 18 4
retrieve product attributes 9 9 0
# api.benchmark variant
test name left count right count duplicate count
------------------------------------------- ----------- ----------- ---------------
product variant bulk create 51 51 3
retrieve variant list 23 23 9
# api product sorting attributes
test name left count right count duplicate count
------------------------------------------- ----------- ----------- ---------------
sort product not having attribute data 21 21 0 |
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.
Have you tested these changes with any payment gateway?
|
||
# return the success response with the newly created order data | ||
return CheckoutComplete(order=order) | ||
return CheckoutComplete(order=None, confirmation_needed=True) |
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.
Don't we need a separate mutation for payment that needs confirmation?
Now we have CheckoutComplete
but we don't complete the checkout as we need to do additional steps.
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.
What should be the next step in the checkout flow when we get CheckoutComplete(order=None, confirmation_needed=True)
?
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.
You confirm payment client side (depends on gateway) and call again.
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.
So to finish checkout I need to execute mutation CheckoutComplete
twice?
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.
yes, in case there is additional confirmation required, you need to call mutation again
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.
Have you tested these changes with any payment gateway?
That's a tricky part, little hard without a working client. I'll try to do that, but the real test will be integrating the stripe backend with a real client.
@korycins |
We officially support Braintree and Stripe. Is this PR tested with these gateways @salwator? |
@salwator OK so if we know what needs to be done to fully support two-factor payments let's gather these requirements in one GH issue. |
This PR enables our checkout process to handle additional confirmation step needed for multi-factor authentication.
checkoutComplete mutation now returns additional flag indicating that action is required by payment gateway, next call will confirm payment instead of capturing again.
Fixes #4773
Pull Request Checklist