#jskitz-webhhoks
1 messages · Page 1 of 1 (latest)
Hi there! Are you creating a $0 Subscription?
If so, there won't be a payment_intent.succeeded event.
no I'm not. I'm creating a $6/mo subscription
Weird
I'm also not getting invoice.paid
Can you provide an example ID?
I get these every time:
"type": "checkout.session.completed"
"type": "charge.succeeded"
"type": "payment_method.attached"
"type": "customer.created"
"type": "customer.updated"
"type": "invoice.created"
"type": "invoice.finalized"
"type": "customer.subscription.created"
"type": "invoice.updated"
"type": "customer.subscription.updated"
A subscription ID? which ID would you like?
Yep Subscription ID is great
sub_1KtCvkGlyfQqa0B5wS2P9PB0
this is in Test Mode
not sure if this is related, but I also get pending_webhooks: 2 on every message. Not sure why that never gets down to zero
So I do see a payment_intent.succeeded event for that Sub and it has a successful response from the CLI. Check evt_3KtCvlGlyfQqa0B50Ub3vwOK
does the payment_intent.succeeded come delayed by some amount of time?
No it should not
Looks like it came 2 seconds after the checkout.session.completed in this case
okay, I can run it right now and give you the trace
if you can give me just a minute
Sure
because I traced three times yesterday, different users, it didn't come through
I'm going to need to step away myself in a minute, but a colleague is here and will step in.
great, continue to respond here?
Yep!
Okay, I just did a trace, and I'm still getting all the same events but not payment_intent.succeeded
"type": "charge.succeeded"
"type": "checkout.session.completed"
"type": "payment_method.attached"
"type": "customer.created"
"type": "customer.updated"
"type": "invoice.created"
"type": "invoice.finalized"
"type": "customer.subscription.created"
"type": "invoice.updated"
I just ran this for a new user
You are using the CLI to forward to your local endpoint?
yes and that endpoint logs every event
I'm using it like this:
stripe listen --forward-to localhost:5010/payments/webhook --format JSON | grep '^{"api_version"' | jq
sorry, it's localhost:4242 for this demo, but everything else is the same... also my app is logging the received events
actually, maybe it did come in correctly, but for some reason, it's not being logged to the console?
from the webapp logs, I'm seeing it
Yeah that's what I'm wondering
I see the event going through
So it makes me think it isn't getting logged on your server
What's your local endpoint look like?
I'm seeing this from the web app logs
event charge.succeeded
event checkout.session.completed
event payment_method.attached
event customer.created
event customer.updated
event invoice.created
event invoice.finalized
event customer.subscription.created
event invoice.updated
event customer.subscription.updated
event invoice.paid
event invoice.payment_succeeded
event payment_intent.succeeded
event payment_intent.created
which seems reasonable to me... but that's not what was logged from the stripe listen CLI log
but this makes me feel better
the local endpoint is just a python flask app, and it logged those... the other trace I sent you was from the Stripe CLI, which perhaps the problem is my grep clause?
follow up question: is there a way to listen to stripe messages, output to json and pipe it through jq without doing the grep?
jq will fail if I don't have a grep on there
stripe listen --forward-to localhost:5010/payments/webhook --format JSON | grep '^{"api_version"' | jq
basically I'm trying to find the start of the json block to pipe through jq
Ah I misunderstood
Hmmm yeah I haven't played with the CLI like this
But that would make sense to me
seems like those payment_intent events don't start with "api_version"
They should
It should be "id": "evt_xxxx", "object": "event", "api_version": "2020-08-27", etc.
For all
a lot of them start with api_version and I guess some don't... maybe I can just look for {" - I'll try that. Okay, so I'm not losing events. One last question, when I go live, I shouldn't be listening to everything.. just the ones I need, correct?
Correct so that you don't overload your handler
the order of the logs on Stripe and the order of the events on my web app are different. That's normal, right?
thanks! I think I'm good for now. Appreciate all the help
Sure thing!