#Dev!!
1 messages · Page 1 of 1 (latest)
Hello!
That error indicates the transaction was declined because it required authentication, but you're using error_on_requires_action which does not support authentication.
What's your question about this error and these screenshots?
When payment is succeeded then why it's showing an authentication error after the payment?
We are using the stripe module on the Magento website - Through the frontend, it's working fine.
But when we are trying to place orders through API it shows error.
Because the test card you used doesn't support authentication. An authentication attempt was made, the card doesn't support it, so you see those messages.
What scenario are you trying to test? Perhaps you need to use a different test card.
Flagging this is a public thread and you just shared your test secret key. You may want to roll that: https://stripe.com/docs/keys#rolling-keys
I understand those are the steps you took, but why are you doing that? What are you trying to test?
Actually we are providing APIs to mobile team for the apps
They are trying to place order through Stripe payment method.
But it's not working for us
And if we don't require authentication
Then why it's showing next action here: https://prnt.sc/Zqr1NQ3wRUNm
That specific payment appears to require authentication because the Stripe account you're using is in India.
Let's back up.
I'm still not sure what your goal is.
Can you explain what the ideal outcome here is?
Our primary goal is to place an order through the stripe payment method through the mobile app.
Okay. Are you using error_on_requires_action?
We are using stripe payment method on Place order API - pm_1LjmNESH1PKHEa2pvRhhE35P
Then Magento Stripe module shows authentication error: Authentication Required: pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p
No
And other point is this client secret not available in any responses - pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p
Not sure from where its coming from
Why did error_on_requires_action show up earlier in the beginning of the thread, in the original error you posted? That Payment Intent (pi_3Ljm7ASH1PKHEa2p0lhwGMSC) did use it.
That's not how error_on_requires_action works. That property instructs the API to throw an error instead of proceeding with the authentication process. It's basically how you tell Stripe your integration does not support authentication/next actions.
Okay, setting error_on_requires_action aside, let's go back to one of the other things you said, about the client secret.
It sounds like you might be trying to retrieve the client secret from a mobile app using a publishable key, but it's not showing up. Is that the scenario?
Yes, I think it's just confusing for me right now.
Will you please just provide me the steps to create order through payment method in app.
So, I can test according to your instructions
We have a guide for doing that here: https://stripe.com/docs/payments/accept-a-payment
Have you read through that?
Yes
What part of that process are you getting stuck on?
For more clarity - Two teams working on this project.
I am working on the website part and with mobile API development.
And another team - Working on the mobile app.
I am providing them payment intent API response - with client secret and publishable key
Mobile team using SDK to confirm payment -
And after that they are using our order API with payment method - Showing authentication error and some times customer related error when we are not attaching customer object to intent API
We are using Magento stripe module - which is working fine when we test from frontend.
And module supports APIs as well.
Okay, so let's focus on one specific issue. You mentioned an authentication error is sometimes shown. Can you clarify what that means? Where does the error show up? What does it say?
Authentication Required: pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p
Is your integration not set up to handle authentication when it's required?
Not sure if this is server side issue or Client side
I'm still not clear what the issue actually is. 😅
We are just using payment intent API for them to provide client secret amd key
Let me ask this another way: why is authentication being required a problem?
Authentication being required is normal and expected.
But it seems like there's some issue with it when it comes to your integration, which is what I'm trying to understand.
we completed the next step action, and payment is showing success as well.
And at the time of the order stripe API showed again authentication error to us
This is the only issue we are facing now
Wait, I don't understand what that means. Let's break this down one piece at a time. What does "we completed the next step action" mean exactly? This Payment Intent is still in requires_action status, so no next action has been completed.
That is a completely different Payment Intent. Let's focus on pi_3LjjZxSH1PKHEa2p1f6p1HOL specifically.
The next action for that Payment Intent was never completed.
No, can we please focus on pi_3LjjZxSH1PKHEa2p1f6p1HOL first?
okay
You provided that as the one to look at above. Can you tell me why the next action was never completed?
Don't know about this intent
It's not showing on stripe dashboard as well
But it showing on error
Authentication Required: pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p
That's not an error, it's normal.
Authentication being required for any transaction is normal.
Why are you calling it an error? Is it manifesting as an error somewhere in your system?
To clarify, with pi_3LjjZxSH1PKHEa2p1f6p1HOL, I'm seeing zero errors on our side for it.
Magento API showing as the error message
Are you able to see this intent?
Yes. I see zero errors.
Can you show me a screenshot of the error message you're seeing?
That's not an error, that's the message from the Stripe API. What's the actual error?
Yes, Message.
I just used the intent confirm API and tried again with a payment method
Now new message: Authentication Required: pi_3LjnCHSH1PKHEa2p1Q1mXa0c_secret_hoXjk8GqgCqjtFtJeyMYvmDxr
I just want to complete this step -
To successfully pace order
In Magento
And one more thing noticed
All these intents are linked with same payment method: pm_1LjmNESH1PKHEa2pvRhhE35P
That we are using now
So does the issue boil down to your integration not supporting authentication/next actions?
Right... but let's back up a bit.
You're trying to confirm this Payment Intent with a secret key on your server, meaning the cardholder isn't around.
When you do that, and authentication is required, the next step is to bring the Customer back on-session to complete the authentication process. Is your integration set up to do that?
yes, on session will be done on the client side by Mobile team
Website is working with on-session
Still, We can't go through this hurdle
I don't how they place order through app
Can you explain to me why though? What is the specific problem you're facing?
I would love to help, I just don't understand the problem.
I just want success message with order id
Can you see this in your Dashboard? https://dashboard.stripe.com/test/logs/req_pBfTqx9GfJVzZR
Okay, so that's the first attempt to confirm this Payment Intent.
See how it's using your secret key?
This request was made from your server.
It specified a return_url, which means you're telling Stripe that you want to handle the authentication process manually, as documented here: https://stripe.com/docs/payments/3d-secure#when-to-use-3d-secure
Is your integration set up to do that? Meaning it takes the next_action.redirect_to_url.url and sends the cardholder to it?
Yes, you send the cardholder to the next_action.redirect_to_url.url so they can authenticate the payment.
No. Authentication is required for some transactions. In India, it's required for almost all of them.
Wait, maybe I misunderstood your question.
Can you clarify what you mean by "don't want to use any url"?
Means while placing order through mobile app
They are in app and this method requires URL for authentication
It means they required browser to open an URL
outside of the app
That's correct, yes.
Well, it doesn't have to be outside the app.
It can be a web view inside the app.
Alternatively, you can adjust your integration to use our native mobile SDKs and handle authentication that way, without a web view.
Yeah, that request didn't specify a return_url.
So we're assuming you're using our client-side libraries/SDKs, which will handle the authentication process for you.
Can you tell me more about your mobile app?
Are you using one of our native SDKs to build it?
Knowing what the mobile app is using and how it works is critical to getting this flow right. Can you ask them?
Android app - Using flutter
Ah, okay. We don't officially support Flutter, but there are third-party solutions. Do you know if a third-party Flutter/Stripe library is being used? If so, which one?
They are using SDK
Which one?
Can you provide a link to the specific SDK/library they're using for Stripe in the app?
Don't know much about this
- They just said us - payment is succeeding from SDK
I need to check with them about this
What it boils down to is, if the SDK they're using uses the official Stripe mobile SDK under the hood, you can omit the return_url when confirming server-side and pass only the client_secret to the app. However, if an official Stripe mobile SDK is not being used, you'll likely need to keep the return_url in the confirmation request and manually direct the cardholder to the next_action.redirect_to_url.url in the app.
Okay
On requests, I clicked the next action it showing order data in requests
in s tripe dashboard
Yeah, because you visited the next_action.redirect_to_url.url manually, which completed the payment.
What does "in admin" mean?
In Magento admin
I'm not really familiar with Magento, so I don't know what that means. Can you provide more details?
So you're seeing successful payments in the Stripe Dashboard, but in Magento they're not showing up as paid?
yes
Have you set up webhooks to get notified when async payments go through?
I think magento module is doing that
Can you confirm they're working as expected? Do you see them set up without errors here? https://dashboard.stripe.com/test/webhooks
And that's in test mode?
yes
Can you give me a Payment Intent ID which is showing as successful in Stripe but not in Magento?
pi_3LjnJmSH1PKHEa2p1uKFVaNA
Both the payment_intent.succeeded and charge.succeeded Events for that payment were successfully sent to your Webhook Endpoint:
https://dashboard.stripe.com/test/events/evt_3LjnJmSH1PKHEa2p1zqst0Qc
https://dashboard.stripe.com/test/events/evt_3LjnJmSH1PKHEa2p1TOeu4om
It seems like something is going wrong when processing them.
I can't say what it might be, as it's on your end after delivery.
What do you mean by "an order"?
means using stripe payment method
You can create a Payment Intent using Postman.
When you say "order" I'm not sure what you mean, but I think you might be talking about a Magento order?
yes
I don't know what the Magento side of things would look like, and can't say if you can create a Magento order with Postman or not. My guess is probably not, but it's just a guess.
Yes we can create order through Postman using APIs
Okay.
what we can do after the payment intent through Postman
confirm payment intent API right?
Yeah, you can do anything listed in the API reference here: https://stripe.com/docs/api/payment_intents
Using confirm API - we just need to send return URL