#dhruv_api

1 messages ¡ Page 1 of 1 (latest)

remote plumeBOT
#

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

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

wraith cape
#

Hi there! You can't manipulate a PaymentIntent's status directly

#

and canceled is a terminal state

signal pagoda
#

Ohk, can you please tell me how we can fix this and not get this error

wraith cape
#

So you created this PaymentIntent and then confirmed it and then it became canceled 7 days later

#

And then you tried to capture it after that, but it is already canceled. So there are sort of two quesitons - how do you prevent that scenario and how do you react to that scenario

signal pagoda
#

Yes

wraith cape
#

As far as prevention, I think this is probably cancelled because the authorization is only good for 7 days, but let me check on that

#

Yeah that seems to be correct

#

We give you a cancellation_reason in that event

#

But ultimately you'll need to proceed by creating a new PaymentIntent. If you know the amount you want to capture at that point you can just create and confirm a PaymentIntent in a single API call by passing confirm: true - see our api reference

signal pagoda
#

And what should be the value of confirmation_method

wraith cape
#

you would omit it

signal pagoda
#

Got it

#

So just pass the confirm true and that should automatically capture as well, right?

wraith cape
#

Yep; automatic capture is the default on the PaymentIntents api. You only get manual capture by explicitly requesting it