#fredo_webhooks
1 messages · Page 1 of 1 (latest)
👋 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/1318170563289813022
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi
First of all are you using Stripe test clock ?
https://docs.stripe.com/billing/testing/test-clocks
And one of these test cards ?
https://docs.stripe.com/testing#international-cards
If so, could you please share a Subscription Id ?
Yes
I have this setup but I don't see anything moving on my laravel webhook logs.
Now could you please share a Subscription Id attached to this test clock ?
clock_1QWbOrEpArSPN3QttqTW0UMK
Ok, but I would like to share the Subscription Id you created for your test
sub_1QWbnWEpArSPN3QtaxHSpY8Z
sub_1QWbrYEpArSPN3QtT2EeJdzW
I have 2
Great thanks
sub_1QWbnWEpArSPN3QtaxHSpY8Z this one is not attached to a simulation
While this one sub_1QWbrYEpArSPN3QtT2EeJdzW is attached to another test clock clock_1QWbsvEpArSPN3QtFAK6hWQw
Yes, I only have one, but nothing changes on my end.
Focusing on the last one then.
Of course
I do see an event evt_1QWbrqEpArSPN3QtuWRpghOj generated on Stripe Side
And it was sent to your Stripe Cli local listener
and to this webhook endpoit we_1QSha5EpArSPN3Qtp67T9oUr
is was my webhook for dev we_1QSha5EpArSPN3Qtp67T9oUr
You receved that even on that webhook then.
Have you had the chance to double check your logs ?
i have this log when i put this command on CLI stripe trigger invoice.payment_succeeded
I think I must be doing something wrong, but I can't think what.
This will triggers an event
You want to simulate an event or get an even related to the Subscription you created ?
You should be using listen and not trigger
In order to test your handler (Webhook endpoint listener), I encourage you to follow this guide:
https://docs.stripe.com/webhooks#test-webhook
I'll tell you exactly what I want to do. I've created a subscription via my solution and I'd like to simulate that we're at the end of the month so that Stripe can debit my customer and therefore interact with my code to make an invoice, renew the customer, send an email, etc.
it doesn't seem to work for me via the online CLI and the webhook seems to work well because I can pay well, it's just to test a customer's direct debit which doesn't work for me.
with my code to make an invoice, renew the customer, send an email, etc.
If you are using Stripe Subscription, you don't need to recreate invoice manually...
The invoice will be created automatically
I was talking about creating the invoice on my side and not on Stripe's side.
Sorry I'm not sure I understand what is not working exactly ?
Received invalid flags for this command: --forward-to
The event evt_1QWbrqEpArSPN3QtuWRpghOj was sent to your webhook endpoint we_1QSha5EpArSPN3Qtp67T9oUr correctly, and your endpoint responded successfully. Sorry, but I'm not sure I understand what is missing ?
--forward-to should be localhost
if you have a hosted url, then use webhook endpoints (like you did with we_1QSha5EpArSPN3Qtp67T9oUr)
now I've changed the time of the test clock cus_RPQEmOBQ4XD7eU but I don't see anything moving in the webhook logs.
clock_1QWbOrEpArSPN3QttqTW0UMK sorry
Could you please share the Subscription Id ?
sub_1QWbNtEpArSPN3QtYPhYNKmi
There is this event generated evt_1QWbO9EpArSPN3QtxMPGtzzr
You should be able to check it from your Dashboard:
https://dashboard.stripe.com/test/events/evt_1QWbO9EpArSPN3QtxMPGtzzr
And it was sent to the same 3 endpoints
Okay, so the link you sent me means that the customer has been debited automatically, right?
yes
You can view the full events generated:
https://dashboard.stripe.com/test/subscriptions/sub_1QWbNtEpArSPN3QtYPhYNKmi
Ok, but here's my question: why don't I see any results in the webhook (which is also why I don't have anything in my laravel logs)?
You should check your logs/ add breakpoints and debug your integration.
As far as I can tell that your webhook endpoint did responded successfully
to the event generated
I already have logs everywhere in PHP and on the stripe panel I don't see any call webhook either.
n the stripe panel I don't see any call webhook either.
What you mean on this ? could you please share a screen shot ?
Between, your webhook endpoint responded with {"status":"skipped"}
You should be able to view it in the event details:
https://dashboard.stripe.com/test/events/evt_1QWbO9EpArSPN3QtxMPGtzzr
Isn't the 9th event ?
The last logs I have in the webhook are only when I've changed the time of the sampling test.
Maybe you are looking to the wrong place then
And the logs are probably logged elsewhere... Sorry but Stripe has no control over your integration.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Have you had the chance what is the origin of that response ? status: skipped ?
no I don't see why I have this
As far as I can tell is that this is the response of your webhook endpoint.
Great, I invite you to double check and debug your integration first then.
And I usually recommend running this quickstart:
https://docs.stripe.com/webhooks/quickstart?lang=php
yes
I invite you to check the Event Payload at, you should have it
https://dashboard.stripe.com/test/events/evt_1QWbO9EpArSPN3QtxMPGtzzr
Ok I'm going to annalyze better, you've already helped me a lot to get the list of events (I didn't have it)
Np! Happy to help!
Can you leave the ticket open so that I can reread your previous answers?
We usually, close the thread after un-activity. But please don't hesitate to open a new thread (it will reference automatically this one).
After checking my code is in the webhook so if Stripe doesn't go through the webhook for the clock test my code will never work that's why I always have NULL in my webhook logs.
[2024-12-16 11:53:29] local.INFO: ==========================================
[2024-12-16 11:53:29] local.INFO: No subscription invoice found, skipping {"stripe_invoice_id":"in_1QWbvVEpArSPN3QtZgOnnQGU"}
[2024-12-16 11:54:32] local.INFO: Stripe webhook request received {"url":"http://194.87.217.143:8083/stripe/webhook","method":"POST","has_stripe_signature":true}
[2024-12-16 11:54:32] local.INFO: Webhook request received {"url":"http://194.87.217.143:8083/stripe/webhook","method":"POST","has_stripe_signature":true}
[2024-12-16 11:54:32] local.INFO: Processing webhook event {"type":"charge.succeeded","event_id":"evt_3QWbwYEpArSPN3Qt1Q9o5Cto"}
[2024-12-16 11:54:32] local.INFO: ==========================================
[2024-12-16 11:54:32] local.INFO: Processing invoice payment succeeded: {"invoice_id":"ch_3QWbwYEpArSPN3Qt1y0n6xUa","subscription_id":null,"customer_id":null,"payment_intent":"pi_3QWbwYEpArSPN3Qt1aHtMHKJ","amount_paid":null}
[2024-12-16 11:54:32] local.INFO: ==========================================
Great, glad to hear that you manage to find the good logs line.
We agree that when Stripe automatically debits a customer, there should be a webhook event invoice.payment_succeeded ?
there should be a webhook event invoice.payment_succeeded ?
Yes, and it was generated (I shared couple of examples before in this thread I think)
Ok so I'm going to review and better analyze everything now that I'm familiar with the subscription process. Thanks for your answers and sorry for wasting your time.
Not at all! Always happy to help!
Sorry to bother you again, but when I run a clock test I get strictly nothing in the workbench events. How did you manage to get all the IDs (especially where we could see the skipped status)?
Click that evt_xxx ID on the right pane
You're looking at the webhook conversations specifically, rather than the event detail view
I was talking about having the event when the test clock is well done to see the test feedback.
I don't know what you're describing sorry
i have this subscription sub_1QWcdfEpArSPN3QtsN7Amve9
But I can't perform a Stripe sampling test, when I advance the testclock to now I don't see any log in the webhook or even in the events.
What event(s) are you expecting to see?
I don't know, but having a sign of life so that my backend can go to the next step once Stripe renews the client
You likely need to advance the clock further beyond the next billing period and then associated events will fire
So I have to wait 1 month to do the test?
Or should I set the test clock for 10 minutes from now, for example?
No, advance the clock to the next billing date which is 2025-01-16
Right now the clock is 'frozen' on 2024-12-16
I was thinking that the clock test could simulate a renewal in a few minutes, for example, and that's what I'm trying to do 🙂
Yes, that's exactly what it does but you need to manually advance the clock to the time/date you want
that's what I'm doing, but when we arrive at the time I indicated, nothing happens in the event logs or webhook.
Well that's not true. I can see the customer.subscription.updated event (https://dashboard.stripe.com/test/events/evt_1QWcduEpArSPN3QtiXXiygtJ) that fired on the test clock time of 2024-12-16
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
As I said, you likely need to advance it to the next billing date – 2025-01-16
How do you get the event ID?
Well I'm using internal tooling, but you can just look on the Dashboard page for the subscription at the bottom
Ha mais l'ID que vous m'avez donné lui c'est pour la création de l'abonnement et non via le test clock
We only speak English here
I use internal tools, but you can simply look at the dashboard page for subscription at the bottom of the page.
sorry
wait 2s 🙂
Ha but the ID you gave me is for the creation of the subscription and not via the test clock.
Yes, because you haven't advances the test clock beyond the creation date of the sub
I think I'm going to change my whole system so that it's my backend that collects the customers, I can't figure out how the tests work here.
If you're trying to receive and forward events (like invoice.paid) for that subscription then all you theoretically need to do is advance the test clock time like I said
I advanced the time 15 minutes ago to 1:30 pm, so technically I should have logs.
It's frozen now on the same date as the subscription creation. It doesn't automatically advance
Which clock ID? Because clock_1QWcfsEpArSPN3Qtl2SnMd1b is what controls the sub you shared (sub_1QWcdfEpArSPN3QtsN7Amve9)
Maybe you're advancing the wrong clock or something?
clock_1QWcfsEpArSPN3Qtl2SnMd1b
I only have one clock and one subscription that are connected
And now I see nothing in the logs, even though the time has passed.
Where's the API request where you advanced the clock? You can see in your screenshot it's still frozen to now
Yes, because those events have already fired. You need to advance to the next billing period
Please just try what I'm suggesting 🙂
Yes, because I want to do the test now and not in 1 month.
Then you need to start over
Or delete the clock and recreate a new one?
Ha so that's why it doesn't work so I can't shift the hours infinitely?