#naama-magami_webhooks

1 messages ยท Page 1 of 1 (latest)

zinc novaBOT
#

๐Ÿ‘‹ 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. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— 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/1214258497856737280

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

hollow spruceBOT
dense trench
#

If there is a payment intent associated with this Checkout Session that will be canceled.

trim nest
#

ill exaplain better - im creating a new checkout session, and in return i get the session url.

#

is the payment intent created event sent at the same time that the session is created?

dense trench
#

That depends on your API version

trim nest
#

how come?

dense trench
#

In earlier API versions, the Payment Inten was created at the same time the session was created. Starting with version 2022-08-01, we only create the Payment Intent when the customer confirms the payment

trim nest
#

how can i know the api version im using? i see i use stripe-go/v72

dense trench
#

Are you logged in to your stripe account in a browser?

trim nest
#

yes

dense trench
#

When you go to the API reference doc, you should see your Account name and the default API version in the lower left corner of your brownser
https://docs.stripe.com/api

trim nest
#

ok its 2020-08-27

#

but if i'll add a new account, it will have the new flow right?

dense trench
#

Correct

trim nest
#

i still don't understand exactly when does it mean "when the customer confirms the payment". If the customer sees the checkout page, he enters he's payment method details and then clicks pay - when does the payment confirmation happenes?

dense trench
#

When the customer clicks the Pay button (after filling out their payment method details).

trim nest
#

oh cool, ok thanks!
and regarding the canceled event, when is the payment intent being canceled?

dense trench
#

When the session expires.

#

If there is a Payment Intent associated with it

#

So that would only happen on older API versions

trim nest
#

so because older api versions create the payment intent when the session is created - the payment_intent.canceled event will be sent when the session is expired?

#

and in newer versions, do we have this event?

dense trench
#

Correct

#

In the newer API version, the Payment Intent doesn't get created so the event doesn't fire

trim nest
#

also, is the payment intent created if the user clicks pay but the paymet failed?

dense trench
#

Yes

#

In those cases you will see the payment_intent.payment_failed event fire

trim nest
#

and when will i see the payment_intent.canceled event?

dense trench
#

What do you mean? I just told you. In the old API version, you will see it when the session expires. In the newer version you won't. The only time you would see the canceled event fire is if you created a standalone Payment Intent and then manually canceled it.

trim nest
#

i mean in this case we just talked about in the new versions - when user tries to pay but payment fails, cause we said that the payment intent is created this way

dense trench
#

If you manually cancel it.

#

Payment Intents do not expire

trim nest
#

but what if the session expires here? cause we do have a payment intent now

dense trench
#

Sorry I find this line of discussion very confusing. What scenario are you referring to in this case?

#

You can, and should, test your entire flow end to end for all scenarioes in Test mode. That will generate all of these events and allow you to clearly identify exactly when they will occur

trim nest
#

in the new api version, the customer tried to pay and failed. in this case we said that the payment intent is being created.
so we have the events:
payment_intent.created
payment_intent.failed
right?
so, if we have the payment intent connected to the session, won't we also get the payment_intent.canceled when session expires?

dense trench
#

No, the session does not expire. It was successfully completed and checkout.session.completed will fire.

#

The completion of the session just means the customer succesfully completed the form and attempted to confirm the payment

#

Whether that payment fails or succeeds

trim nest
#

no, i mean in case the customer didn't pay at the end

#

oh..

dense trench
#

It's much easier to get your head around once you see it in action

trim nest
#

ill try to, thanks!

dense trench
#

There's even a whole set of different webhook events if you are using an async payment method. For example, if you plan on accepting payments using Direct Debit, the payment might not fail for up to 3 days. You can use these test details to try that out too.
https://docs.stripe.com/testing#non-card-payments

#

Or, if the payment goes through, checkout.session.async_paymnet_succeeded