#.suryamani

1 messages · Page 1 of 1 (latest)

restive spindleBOT
crystal anchor
#

I have testing Which event will trigger during auto renewal payment success or failed

#

But i got customer.subscription.updated event for both auto renewal payment success or failed

spring plinth
#

This is exepcted because the subscription is updated anyway regardless of payment succeeded or failure

crystal anchor
#

i need to send mail when payment is failed. So, I' using webhook events for send mail based on the event triggered

spring plinth
#

Then listen to invoice.payment_failed events

crystal anchor
#

But this event is not triggered when payment failed during auto renewal how will i solve it

spring plinth
#

What's the invoice ID?

crystal anchor
#

in_1NzaRALabf7E4J4FvopMaBXp

spring plinth
crystal anchor
#

What is this?

spring plinth
#

The invoice.payment_failed event

crystal anchor
#

I know about that event for me that event is not trigerred when payment failed how will i solve that issue

spring plinth
#

What make you think that this event is not triggered? The event was generated based on the log

crystal anchor
#

During auto renewal when payment is failed which event will generate

spring plinth
#

invoice.payment_failed

crystal anchor
#

But for me customer.subscription.updated event is generated

restive spindleBOT
nova path
crystal anchor
#

i need to send mail when payment is failed. So, I' using webhook events for send mail based on the event generated

nova path
#

Then use invoice.payment_failed

crystal anchor
#

I write code like this in this code email send based on which event generate in stripeEvent.Type

nova path
#

I'm not sure if there's a question there for me to answer

crystal anchor
#

If invoice.payment_failed event is generated in stripeEvent.Type then payment Failed mail is sent to customer but unfortunately for me customer.subscription.updated event is generate in stripeEvent.Type, I'm asking you to how i will solve it

nova path
#

So you're not receiving an invoice.payment_failed event?

crystal anchor
#

yes

nova path
#

What's the in_xxx/sub_xxx ID?

crystal anchor
#

in_1Nza1BLabf7E4J4F3lIAenMH

nova path
#

I would expect that you never received an invoice.payment_failed event because there was no failed payment attempt for that Invoice. It was paid successfully on the first attempt

crystal anchor
#

in_1NzaRALabf7E4J4FvopMaBXp

nova path
#

Looks like we sent it to a few webhooks too

crystal anchor
#

This invoice shows invoice.payment_failed event for you

nova path
#

Sure, I just sent you the Dashboard link

crystal anchor
#

Then why in API i got this event customer.subscription.updated

nova path
#

Your webhook code should be able to handle multiple event types

nova path
#

Not sure what you're sending me here?

crystal anchor
#

I'm sending a screenrecord what i doing

#

Please see this

nova path
#

How is the recording relevant?

crystal anchor
#

During testing the issue i have faced

nova path
#

Sorry, it's a 7 minute long video. I don't have time to sit and watch all that

#

Can you summarise the issue?

crystal anchor
#

please see the final part of this video

nova path
#

I can't really make the video out as it's small and there's a huge watermark across the middle

crystal anchor
#

Im using free version so the watermark will there

nova path
#

Yeah, that's not ideal I'm afraid. Please describe the issue here as I don't really understand what the video demonstrates

#

Your webhook code needs to be able to handle both event types as they will both likely fire when a payment fails

crystal anchor
#

But for me only one event is generate

nova path
#

That's not true. I've sent you links that show you both events are created and sent

crystal anchor
#

But for me not like you saying so only i have sent screen recording

nova path
#

I can't make anything out from that video I'm afriad

crystal anchor
#

Did you understand what is my issue

nova path
#

I don't I'm afraid. You seem to think you're not receiving an invoice.payment_failed event, yet everything from our logs indicates you are

#

Which webhook endpoint are you expecting to receive both events at?

restive spindleBOT
crystal anchor
#

I have face some issue please see this video

forest heron
#

@crystal anchor I think we have been discussing this since last week

#

You may have multiple events triggered after an action so you need to make sure that your integration send only one email and not multiple

#

You can't configure Stripe to send only 1 event at once

crystal anchor
#

This is another one issue

#

Now I'm getting single event only but for payment failed i received customer.subscription.updated event

forest heron
#

No you are receiving invoice.payment_failed

#

Here is the event Id evt_1NzaRvLabf7E4J4FVrkpGs6Q

crystal anchor
#

No I'm receiving this one customer.subscription.updated

#

So only i send my screen recording

forest heron
#

Try doing your test again.

#

You are listening/expecting this event to come to which Webhook Id ? or Stripe Cli ?

crystal anchor
#

I expecting this in webhook API

forest heron
#

What webhook API ? how are you listening to the webhook ?

#

using Stripe Cli or a web endpoint ?

crystal anchor
#

Web endpoint

forest heron
#

Can you share it here ? http://...

crystal anchor
forest heron
#

Ok so you are using Stripe Cli Listen

#

to redirect the webhook messsages

#

I see that your endpoint consumed the event

crystal anchor
#

Yes

#

For others it generate correct event only for payment failed it generate customer.subscription.updated event

forest heron
#

No it generates both

#

We already shared with you an event Id

crystal anchor
#

But it shows only one event in API that is customer.subscription.updated

forest heron
#

You are missing it

#

Try to log every single event you got on your webhook integration

#

and make the test again

#

You'll see it in your logs