#leee-webhooks

1 messages · Page 1 of 1 (latest)

sweet spade
#

@echo crow hi! hmm, you should get the checkout.session.completed event if you're using Checkout, and that does have the ability to then look at the products sold+quantity.

Do you have an example evt_xxx event ID for example charge.succeeded where you didn't get a corresponding checkout.session.completed event?

echo crow
#

Hi Karllekko! I'm sure it's me doing something odd. Just give me two seconds, I'll push a new one through.

#

"evt_3Jgn6rIWWRDWPXIw0uslQfPS"

#

The only thing I can think of is that where the user is redirected to after checkout is currently returning a 404 (because it's redirecting to the live site not my local dev).

#

An example using the CLI:

.\stripe.exe trigger checkout.session.completed
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Setting up fixture for: payment_page
Running fixture for: payment_page
Setting up fixture for: payment_method
Running fixture for: payment_method
Setting up fixture for: payment_page_confirm
Running fixture for: payment_page_confirm
Trigger succeeded! Check dashboard for event details.

and my log:

2021-10-04 11:09:39 --> payment_intent.created [evt_3JgnB0IWWRDWPXIw0R5bOpAz]
2021-10-04 11:09:39 <-- [200] POST https://localhost:44339/stripe-web-hook [evt_3JgnB0IWWRDWPXIw0R5bOpAz]
2021-10-04 11:09:42 --> customer.created [evt_1JgnB4IWWRDWPXIwxXreczqK]
2021-10-04 11:09:42 <-- [200] POST https://localhost:44339/stripe-web-hook [evt_1JgnB4IWWRDWPXIwxXreczqK]
2021-10-04 11:09:42 --> payment_intent.succeeded [evt_3JgnB0IWWRDWPXIw0xnw6Ksn]
2021-10-04 11:09:42 <-- [200] POST https://localhost:44339/stripe-web-hook [evt_3JgnB0IWWRDWPXIw0xnw6Ksn]
2021-10-04 11:09:42 --> charge.succeeded [evt_3JgnB0IWWRDWPXIw0EEgYHzU]
2021-10-04 11:09:42 <-- [200] POST https://localhost:44339/stripe-web-hook [evt_3JgnB0IWWRDWPXIw0EEgYHzU]

sweet spade
#

it's probably 'just' a bug in stripe-cli unfortunately

#

your success page being a 404 should not have any impact

echo crow
#

ooh ouch. Ok, I guess I will try to read through that page and see if anyone found a workaround.

#

thank you for finding that so quickly

sweet spade
#

there are a few workarounds but it's mostly a bug we really need to fix.

echo crow
#

It's a fairly long thread. I'll have a hunt through it. Thanks a lot, I appreciate the help

echo crow
#

@sweet spade just an update in case it helps you help someone else later. The issue seems to be that I'm trying to upgrade my code from an old version of stripe, where checkout did not exist. When you run:
.\stripe.exe listen --forward-to https://localhost:44339:/stripe-web-hook
(I assume) it retrieves which version of the API my live site. Stripe doesn't let me have one version for the test mode and another for the live mode (!), so the listener is either not being sent the events or simply filtering them out
This can be overridden by adding the --latest flag to the CLI listen event.
.\stripe.exe listen --forward-to https://localhost:44339:/stripe-web-hook --latest
in which case the events come through