#sofi-kry_code

1 messages ¡ Page 1 of 1 (latest)

gray estuaryBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1342159003462930473

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

river timber
#

Hello there

#

That talks about the different statuses of a PaymentIntent

flat fractal
#

I read that already, but it's not clear how to deal with those states when the callback is expecting either a success or failure

river timber
#

Basically anything that isn't succeeded would be failed.

flat fractal
#

how come? if it's requires action we need to do the intent confirmation, don't we?

river timber
#

Sorry let's pause for a second.

#

What flow are you trying to accomplish here? The deferred-intent where you are showing PaymentSheet and then calling your backend to confirm the SetupIntent?

#

And are you confirming client-side or server-side?

flat fractal
#

I have a payment sheet with intent configuration

#

I have 2 endpoints, one for creating the intent and one for confirming

#

so what I had understood is that the createIntentCallback is supposed to first create the intent, and based on the status we need to do some more requests

river timber
#

Ah okay I see the confusion

flat fractal
#

I've followed that documentation but it doesn't specify everything I need. If I don't pay attention to the PaymentIntent status, how do I know when to trigger the intent confirmation?

river timber
#

The intent confirmation is handled on the client automatically based on CreateIntentResult.Success(response.clientSecret)

#

You only return an error to the client if your PaymentIntent creation request fails.

#

The actual status is irrelevant -- it will always be in requires_payment_method at that point.

#

(Assuming it is created successfully)

flat fractal
#

I'm a bit lost... I had to add an endpoint to confirm the intent, which receives the confirmRequiredActionUrl and clientSecret, is that not needed?

river timber
#

No you don't need a separate endpoint to confirm the intent.

#

You just need an endpoint to create the intent and that endpoint returns the clientSecret to the frontend.

flat fractal
#

When I comment out the call to confirm, and use the 3d secure test card and mark the checkbox to save it, it doesn't get saved

river timber
#

Are you passing setup_future_usage when you create your PaymentIntent?

#

And do you have an example PaymentIntent ID you can share where you tested that?

flat fractal
#

No, I'm not passing setup_future_usage

river timber
#

Gotcha, then yeah the PaymentMethod won't be saved if you don't do that.

flat fractal
#

I think this is from the last test pm_1QucULF0F6bEajPq3LZaLWJB

river timber
#

Why are you passing confirmation_method: 'manual'?

flat fractal
#

I'm not doing that on Android side, maybe on the backend? I don't know why

river timber
#

Yes that is happening on the backend.

#

So yeah this is why you thought you needed a confirm endpoint.

#

But overall, that is our legacy server-side confirmation flow.

flat fractal
#

so if we change it to automatic we wouldn't need any confirmation?

river timber
#

Yes correct

#

If you change that to automatic then it would be the flow I described above.

#

Where confirmation happens on the client without needing to do anything else on the server afterwards.

flat fractal
#

ok I will need to discuss this with other devs

#

Could we get a support ticket from this conversation to continue tomorrow?

river timber
#

You really shouldn't use confirmation_method: 'manual' at all as that is legacy.

river timber
flat fractal
#

alright, thank you