#Escanor

1 messages · Page 1 of 1 (latest)

hazy boughBOT
lunar sand
#

You're providing the payment method during creation and confirming so it can advance directly to the requires capture state

#

Can you share the creation event id from that timeline?

#

That may just be a transient state during creation, where the settled state is the one you get in the response

errant lion
#

Sure thing!

In order:

  1. payment_intent.created: evt_3Mc9VpIKABX39DDE0UKakpBl
  2. charge.succeeded: evt_3Mc9VpIKABX39DDE0A8YJHUu
  3. payment_intent.amount_capturable_updated: evt_3Mc9VpIKABX39DDE0WsnOjXm

It's strange though, why is there 3 instead of 4 like in my screenshot 🤔 And they're all at 10:36:45 AM, none at the time of the bottom one in the screenshot at 10:36:44 AM

lunar sand
#

The timeline is showing both requests and events

#

you have 1 request and 3 events, 4 entries

#

and the request must precede the events

#

it is what causes them to be emitted

errant lion
#

Ahhh... genius 🤯 lol

#

But still, why would there be an event with the payment intent as requires_source if the response of the first request has it as requires_capture? 🤔

lunar sand
#

Because it may get created internally without that then applied from your request

#

Checking to see if this happens with my default version too

#

Yep, still happens for me with requires_payment_method -- the later event is the one you should pay attention to (amount capturable updated)

#

Or use the response you get from the create call

errant lion
#

Well that's the part that's confusing me. Why use a webhook if I can just pass the confirm option and get the up to date payment intent status right away?

#

Or is it just because I'm in the test environment that it's fast and all?

lunar sand
#

This would be roughly the same in live

#

you dont have to use the created webhook, you can ignore it if you don't need it for anything yourself

errant lion
#

Well would one have a need for the webhook with payment intents only if they don't pass the confirm option?

Because from what I understood, by passing the confirm option, the response I get from the stripe api is the latest, up to date status of the payment intent and it won't change afterwards right?

lunar sand
#

The api response will be the latest version at that time, it could change later though

#

eg using a card and manual capture, if you fail to capture within 7 days the PI will revert to requires payment method (source)

errant lion
#

oh yeah no that's fine by me

#

It just makes me wonder why I would want to use the webhook..? In which scenario? I thought this was like the best thing for our needs, but now I'm wondering why I would want it lol

lunar sand
#

That's up to you, say if you wanted to track all PIs that get created in your own database

#

you don't need to use it, its optional

errant lion
#

Though one use that I can think of is to track when the payment_intent status changes to something else than what it was set to upon creation and confirmation, so that when it's automatically cancelled after 7 days, I'd know right away 🤷‍♂️

Alright, this cleared up my thoughts!