#vinicius-zaramella_api

1 messages ¡ Page 1 of 1 (latest)

late pendantBOT
#

👋 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/1291399230987960341

📝 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.

vague bronze
#

Hello

#

Taking a look

#

Can you clarify why you want to prefill a past PaymentMethod when using a SetupIntent?

#

SetupIntents are meant to collect new PaymentMethods

#

So this doesn't really make sense that it would re-setup the previous PaymentMethod...

tired bronze
#

Our checkout flow is a little bit different in the sense that we initialize the page we don't know yet the amount and lines items that will be purchased

#

It was suggested to us that we could use Setup Intent in that case

#

But only confirm the SetupIntent when a new payment method was added during checkout

#

On page submition we create a confirmationToken that we use to generate an Invoice and confirm the payment intent from the invoice

#

The problem that I am facing is that I have to either start the elements with a Payment Intent or a Setup Intent and neither fits well our use case

#

Is there a way to initialize the elements only with a customerSession that I missed?

vague bronze
#

Then you don't need a PaymentIntent or SetupIntent up front

late pendantBOT
tired bronze
#

But in that doc it says that I need to initialize the payment element with a amount

#

Can I use a fake amount like 0 and then change it later on the server?

boreal raptor
#

But it has to match whatever you create the payment intent with

tired bronze
#

ok, so the value passe to elements.update has to match the invoice amount