#.suryamani
1 messages · Page 1 of 1 (latest)
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
This is exepcted because the subscription is updated anyway regardless of payment succeeded or failure
i need to send mail when payment is failed. So, I' using webhook events for send mail based on the event triggered
Then listen to invoice.payment_failed events
But this event is not triggered when payment failed during auto renewal how will i solve it
What's the invoice ID?
in_1NzaRALabf7E4J4FvopMaBXp
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
What is this?
The invoice.payment_failed event
I know about that event for me that event is not trigerred when payment failed how will i solve that issue
What make you think that this event is not triggered? The event was generated based on the log
During auto renewal when payment is failed which event will generate
invoice.payment_failed
https://stripe.com/docs/billing/subscriptions/webhooks I'd strongly recommend you go through this doc to learn more about using webhook in subscriptions
But for me customer.subscription.updated event is generated
Yup, that will fire too to reflect the failed payment. Totally expected
i need to send mail when payment is failed. So, I' using webhook events for send mail based on the event generated
Then use invoice.payment_failed
else if (stripeEvent.Type == Events.InvoicePaymentFailed)
{
var paymentMethod = stripeEvent.Data.Object as PaymentMethod;
//EmailInvitations.SendSubscriptionRenewalPaymentFailedMail(userEmail, displayName, companyName, AppSetting.AppRedirectUrl);
EmailInvitations.SendSubscriptionRenewalPaymentFailedMail("suryamanivannan1226@gmail.com", "Surya", "Reinvent", AppSetting.AppRedirectUrl);
}
I write code like this in this code email send based on which event generate in stripeEvent.Type
I'm not sure if there's a question there for me to answer
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
So you're not receiving an invoice.payment_failed event?
yes
What's the in_xxx/sub_xxx ID?
in_1Nza1BLabf7E4J4F3lIAenMH
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
in_1NzaRALabf7E4J4FvopMaBXp
I can see a invoice.payment_failed event: https://dashboard.stripe.com/test/events/evt_1NzaRuLabf7E4J4FbRpuLTFO
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Looks like we sent it to a few webhooks too
This invoice shows invoice.payment_failed event for you
Sure, I just sent you the Dashboard link
Then why in API i got this event customer.subscription.updated
Because, as I explained, a customer.subscription.updated event will fire as well as the invoice.payment_failed event: https://dashboard.stripe.com/test/events/evt_1NzaRvLabf7E4J4FVrkpGs6Q
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Your webhook code should be able to handle multiple event types
Not sure what you're sending me here?
How is the recording relevant?
During testing the issue i have faced
Sorry, it's a 7 minute long video. I don't have time to sit and watch all that
Can you summarise the issue?
please see the final part of this video
I can't really make the video out as it's small and there's a huge watermark across the middle
Im using free version so the watermark will there
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
But for me only one event is generate
That's not true. I've sent you links that show you both events are created and sent
But for me not like you saying so only i have sent screen recording
I can't make anything out from that video I'm afriad
Did you understand what is my issue
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?
@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
This is another one issue
Now I'm getting single event only but for payment failed i received customer.subscription.updated event
No you are receiving invoice.payment_failed
Here is the event Id evt_1NzaRvLabf7E4J4FVrkpGs6Q
No I'm receiving this one customer.subscription.updated
So only i send my screen recording
Try doing your test again.
You are listening/expecting this event to come to which Webhook Id ? or Stripe Cli ?
I expecting this in webhook API
What webhook API ? how are you listening to the webhook ?
using Stripe Cli or a web endpoint ?
Web endpoint
Can you share it here ? http://...
Ok so you are using Stripe Cli Listen
to redirect the webhook messsages
I see that your endpoint consumed the event
Yes
For others it generate correct event only for payment failed it generate customer.subscription.updated event
But it shows only one event in API that is customer.subscription.updated