#Dev!!

1 messages · Page 1 of 1 (latest)

stable notchBOT
candid remnant
#

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.

cerulean bear
candid remnant
#

What's your question about this error and these screenshots?

cerulean bear
#

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.

candid remnant
#

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.

#

I understand those are the steps you took, but why are you doing that? What are you trying to test?

cerulean bear
#

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

candid remnant
#

That specific payment appears to require authentication because the Stripe account you're using is in India.

cerulean bear
#

When I clicked the link its shows me authentication complete

#

Am I doing right?

candid remnant
#

Let's back up.

#

I'm still not sure what your goal is.

#

Can you explain what the ideal outcome here is?

cerulean bear
#

Our primary goal is to place an order through the stripe payment method through the mobile app.

candid remnant
#

Okay. Are you using error_on_requires_action?

cerulean bear
#

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

cerulean bear
#

And other point is this client secret not available in any responses - pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p

Not sure from where its coming from

candid remnant
#

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.

cerulean bear
#

I just used it on POSTMAN to check the error

candid remnant
#

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?

cerulean bear
#

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

candid remnant
#

Have you read through that?

cerulean bear
#

Yes

candid remnant
#

What part of that process are you getting stuck on?

cerulean bear
#

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.

candid remnant
#

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?

cerulean bear
#

Authentication Required: pi_3LjjZxSH1PKHEa2p1f6p1HOL_secret_GjWSyLkjdAWQbKDSkw35WpO2p

candid remnant
#

Is your integration not set up to handle authentication when it's required?

cerulean bear
#

Not sure if this is server side issue or Client side

candid remnant
#

I'm still not clear what the issue actually is. 😅

cerulean bear
#

We are just using payment intent API for them to provide client secret amd key

candid remnant
#

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.

cerulean bear
#

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

candid remnant
#

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.

cerulean bear
#

This one

#

I think mobile team is doing this

candid remnant
#

That is a completely different Payment Intent. Let's focus on pi_3LjjZxSH1PKHEa2p1f6p1HOL specifically.

#

The next action for that Payment Intent was never completed.

cerulean bear
#

pi_3LjmMOSH1PKHEa2p1nCLP0Bi

#

check this one

candid remnant
#

No, can we please focus on pi_3LjjZxSH1PKHEa2p1f6p1HOL first?

cerulean bear
#

okay

candid remnant
#

You provided that as the one to look at above. Can you tell me why the next action was never completed?

cerulean bear
#

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

candid remnant
#

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.

cerulean bear
#

Magento API showing as the error message

Are you able to see this intent?

candid remnant
#

Yes. I see zero errors.

#

Can you show me a screenshot of the error message you're seeing?

cerulean bear
candid remnant
#

That's not an error, that's the message from the Stripe API. What's the actual error?

cerulean bear
#

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

candid remnant
#

So does the issue boil down to your integration not supporting authentication/next actions?

candid remnant
#

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?

cerulean bear
#

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

candid remnant
#

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.

cerulean bear
#

I just want success message with order id

candid remnant
cerulean bear
#

from Magento

#

Yes

candid remnant
#

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.

#

Is your integration set up to do that? Meaning it takes the next_action.redirect_to_url.url and sends the cardholder to it?

cerulean bear
#

Okay it means this is returning to website URL

#

For the authentication right?

candid remnant
#

Yes, you send the cardholder to the next_action.redirect_to_url.url so they can authenticate the payment.

cerulean bear
#

is there any other way for app users

#

if they don't want to use any url

candid remnant
#

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"?

cerulean bear
#

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

candid remnant
#

That's correct, yes.

#

Well, it doesn't have to be outside the app.

#

It can be a web view inside the app.

cerulean bear
#

okay

#

This request not showing return URL

candid remnant
#

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?

cerulean bear
#

I am not developing mobile app

#

Another team working on it

candid remnant
#

Knowing what the mobile app is using and how it works is critical to getting this flow right. Can you ask them?

cerulean bear
#

Android app - Using flutter

candid remnant
#

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?

cerulean bear
#

They are using SDK

candid remnant
#

Which one?

#

Can you provide a link to the specific SDK/library they're using for Stripe in the app?

cerulean bear
#

Don't know much about this

  • They just said us - payment is succeeding from SDK
candid remnant
#

Does "us" there mean the word "us" or "United States"?

#

Or something else?

cerulean bear
#

Means to me

#

just calling sdk with parameters to initiate payemtn

candid remnant
#

Which SDK?

#

Please link me to the SDK being used.

cerulean bear
#

I need to check with them about this

candid remnant
#

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.

cerulean bear
#

Okay

#

On requests, I clicked the next action it showing order data in requests

#

in s tripe dashboard

candid remnant
#

Yeah, because you visited the next_action.redirect_to_url.url manually, which completed the payment.

cerulean bear
#

But order not created in admin

#

may be something is missing

candid remnant
#

What does "in admin" mean?

cerulean bear
#

In Magento admin

candid remnant
#

I'm not really familiar with Magento, so I don't know what that means. Can you provide more details?

cerulean bear
#

Means order not placed

candid remnant
#

So you're seeing successful payments in the Stripe Dashboard, but in Magento they're not showing up as paid?

cerulean bear
#

yes

candid remnant
#

Have you set up webhooks to get notified when async payments go through?

cerulean bear
#

I think magento module is doing that

candid remnant
cerulean bear
candid remnant
#

And that's in test mode?

cerulean bear
#

yes

candid remnant
#

Can you give me a Payment Intent ID which is showing as successful in Stripe but not in Magento?

cerulean bear
#

pi_3LjnJmSH1PKHEa2p1uKFVaNA

candid remnant
#

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.

cerulean bear
#

okay

#

Can we create an order through stripe API using postman?

candid remnant
#

What do you mean by "an order"?

cerulean bear
#

means using stripe payment method

candid remnant
#

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?

cerulean bear
#

yes

candid remnant
#

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.

cerulean bear
#

Yes we can create order through Postman using APIs

candid remnant
#

Okay.

cerulean bear
#

what we can do after the payment intent through Postman

confirm payment intent API right?

candid remnant
cerulean bear
#

Using confirm API - we just need to send return URL