#mariuszgit_webhooks

1 messages Β· Page 1 of 1 (latest)

nimble sandBOT
#

πŸ‘‹ 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/1414941238360014868

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tropic prawn
#

hi there!

charred zenith
#

Thanks. But those are the events I received after time advance (1 month):
customer.subscription.updated
homevariants@gmail.com's subscription has changed
111:53:54 AM
invoice.created
A draft invoice was created
111:53:54 AM
invoice.upcoming
homevariants@gmail.com has an upcoming invoice scheduled for automatic payment in 30 days
111:53:52 AM
customer.updated
homevariants@gmail.com's details were updated
111:53:50 AM
test_helpers.test_clock.created
A new billing clock with ID clock_1S5OFG1dm66kXkqZ8kqOgeU6 was created
111:53:50 AM

There is no invoice.paid event. And I dodnt understand why invoice is scheduled for automatic payment in 30 days. Shouldn't it be paid immediately upon issuance?

tropic prawn
#

can you share the Subscription ID (sub_xxx)?

charred zenith
#

yes...

#

sub_1S5O9w1dm66kXkqZqUQeSpiP

tropic prawn
charred zenith
#

invoice.payment_succeeded?

charred zenith
#

Let me try. Give mi 2 min please.

#

So. Ive created new subscription: sub_1S5QSs1dm66kXkqZL7CLfxYW

Everything is ok. I received:
checkout.session.completed
A Checkout Session was completed
12:16:03 PM
customer.subscription.created
homevariants@gmail.com subscribed to price_1S51Uk1dm66kXkqZZAo0oDVL
12:16:02 PM
invoice.payment_succeeded
homevariants@gmail.com's payment for an invoice for USD 10.00 succeeded
12:16:02 PM
invoice.paid
homevariants@gmail.com's invoice for USD 10.00 was paid
12:16:02 PM
invoice.finalized
A draft invoice for USD 10.00 to homevariants@gmail.com was finalized
12:16:02 PM
invoice.created
A draft invoice was created
12:16:02 PM
payment_intent.succeeded
The payment pi_3S5QSq1dm66kXkqZ1zafUNBw for USD 10.00 has succeeded
12:16:01 PM
payment_method.attached
A card payment method ending in 4242 was attached to customer cus_T1TPcRSnOWYY6c
12:16:01 PM
charge.succeeded
homevariants@gmail.com was charged USD 10.00
12:16:01 PM
payment_intent.created
A new payment pi_3S5QSq1dm66kXkqZ1zafUNBw for USD 10.00 was created
12:16:00 PM
customer.updated
homevariants@gmail.com's details were updated
12:16:00 PM

and the invoice.paid event is here πŸ™‚

But...
Now i have clicked in subscription -> simulate -> advance time (1 month and 1 week)

And it works :/ weird...

#

Must check it one more time, but this time with advance time 1month onlyπŸ˜’

tropic prawn
#

And it works :/ weird...
why is it weird that things work?

charred zenith
#

Yes but it should not work ;P

#

I mean it didnt worked before.

tropic prawn
#

what didn't work exactly? I'm not sure I follow.

charred zenith
#

Now in my subscription I have clicked -> Run simulation -> avdance time -> (1month and 1 hour) and I received only:
invoice.created
A draft invoice was created
12:31:46 PM
invoice.upcoming
homevariants@gmail.com has an upcoming invoice scheduled for automatic payment in 30 days
12:31:45 PM
customer.updated
homevariants@gmail.com's details were updated

but no "invoice.paid"

Do You maybe know why?? :/
sub_1S5Qfy1dm66kXkqZvLynURGj

tropic prawn
#

and what's the issue? that you didn't get invoice.paid?

#

because your webhook endpoint didn't respond with a 200 response to the invoice.created event. so the finalizeation of the invoice is delayed by a couple of days.

charred zenith
#

Sooo. If I do not need to edit this invoice, can I just responde with 200 on this event?

case "invoice.created":
console.log("Invoice created:", event.data.object.id);
return new Response("OK", { status: 200 })

tropic prawn
#

correct. or stop listening to that event completly if you don't need it.

charred zenith
#

thank You very much for Your patience

#

are You human or bot?

tropic prawn
#

we are Stripe employees staffing Discord.

#

so definitely not bots πŸ˜…

charred zenith
#

so have a nice day Soma! and thank You very much again!

tropic prawn
#

happy to help πŸ™‚