paymentSecureConfirm mutation error using Stripe gateway
See original GitHub issueHello,
I’m trying to implement 3D secure flow with Stripe and I can’t manage to complete the checkout with cards that require authentication.
I’m trying to call the paymentSecureConfirm
mutation after completing the 3D secure iframe confirmation step but this error shows up in server console:
web_1 | ERROR saleor.payment.gateway Error encountered while executing payment gateway. [PID:100:Thread-8]
web_1 | Traceback (most recent call last):
web_1 | File "/app/saleor/payment/gateway.py", line 212, in _fetch_gateway_response
web_1 | response = fn(*args, **kwargs)
web_1 | File "/app/saleor/extensions/manager.py", line 250, in confirm_payment
web_1 | return self.__run_payment_method(gateway, method_name, payment_information)
web_1 | File "/app/saleor/extensions/manager.py", line 330, in __run_payment_method
web_1 | raise Exception(
web_1 | Exception: Payment plugin Stripe for confirm_payment payment method is inaccessible!
Thanks in advance
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
paymentSecureConfirm mutation error using Stripe gateway
I'm trying to call the paymentSecureConfirm mutation after completing the 3D secure iframe confirmation step but this error shows up in server ...
Read more >Saleor/CHANGELOG and Saleor Releases (Page 7) | LibHunt
A modular, high performance, headless e-commerce platform built with Python, ... and update order and payment fields; drop PaymentSecureConfirm mutation, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Are there any current plans to add support for Stripe 3D Secure authentication in 2021 ?
Apologies for not providing enough details at the start. I just revisited all the steps I followed to implement the checkout and I actually ran into a few more problems along the way. I’ll create separate issues if needed.
My front-end is built with React and Apollo. These are the steps I followed:
1. Create checkout object and update shipping method
No issues here:
View mutations
2. Create Stripe token, create payment object and complete checkout
Below is a simplified version of my React component, for brevity’s sake I removed all error handling.
When the user inserts a credit card number into the card input rendered by
react-stripe-elements
and hits submit, a token is created bystripe.createToken()
. This token is passed to thecheckoutPaymentCreate
mutation. If there are no errors the component calls thecheckoutComplete
mutation to create the charge on the user’s credit card.However this error shows up in the server console after running
checkoutComplete
:The error is caused by the following code in this file:
https://github.com/mirumee/saleor/blob/master/saleor/payment/gateways/stripe/init.py#L48
The error goes away if I replace
payment_method
with apayment_method_data
object like this:After making this change I’m able to complete the checkout succesfully with a credit card that doesn’t require authentication such as this one:
4242 4242 4242 4242
(Stripe test card numbers.) The order shows as fully paid in Saleor dashboard and the charge is successful in the Stripe dashboard.However, the charge is not working with a card that requires 3D Secure authentication such as this one:
4000 0027 6000 3184
. It incorrectly shows up as fully paid in Saleor dashboard, while it is displayed as incomplete in Stripe dashboad as the auth step has not been completed.According to Stripe docs, a PaymentIntent requires a an authentication step if its
next_action
isredirect_to_url
. I was able to get this info by turning off Automatic payment capture in dashboard and inspecting thegatewayResponse
JSON object returned bycheckoutComplete
mutation (I’m not able to findredirect_to_url
if auto capture is enabled):Also, according to the Stripe docs a
return_url
must be set up for the redirect step. For now I just hard coded it in theauthorize
function in the__init__.py
file I mentioned before:Afterwards, using the info in
gatewayResponse
I’m able to create an iframe such as the one in the docs with the 3D Secure UI and complete the authentication step.However, if I try to call the
paymentSecureConfirm
mutation after completing the 3D Secure auth this exception comes up in the server console:Please tell me if you need any additional details, Thanks