#.suryamani
1 messages · Page 1 of 1 (latest)
Hi there, how can I help?
How should i test auto renewal in local? I'm using graduation pricing table
Use test clocks https://stripe.com/docs/billing/testing/test-clocks
if i update plan with this card 4000000000000341 it triggers "customer.subscription.pending_update_expired" this event but if i click step over to run the code the event change into customer.subscription.updated
Can you share with me the subscription ID, and tell me what you expect vs what actually happend?
sub_1NxqodLabf7E4J4FLPq4ZGc1
and what you expect vs what actually happend?
I'm testing webhook events to send custom mail from my side so i click updateplan and change plan and pay via this card 4000000000000341 to check fail payment after i click it triggers this event customer.subscription.pending_update_expired and when i click step over to run program the event will changed to this one customer.subscription.updated
So are you expecting the subscription to be cancelled automatically?
no not like that im try to check which event will trigger when the payment will failed
https://dashboard.stripe.com/test/invoices/in_1NxqodLabf7E4J4FIHoVYfi0 Based on your Dashboard, the payment did fail.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
it shows error when i give wrong card details and payment will fail at the time in webhooks event which event will trigger
I'm afraid that I still struggle to understand what problem you are facing and what you want to achieve here
I'm unable to open this file in my Mac
Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).
No access
I'm afraid that discord is busy now and I don't have time to watch the video
I'm testing webhook events by configure in local Command prompt
If i subscribe, In webhook event customer.subscription.created event will trigger and if i cancel subscription, In webhook event customer.subscription.deleted event will trigger and if i upgrade plan, In webhook event customer.subscription.updated event will trigger but I'm changing plan by using this card 4000000000000341, In webhook event it trigger customer.subscription.pending_update_expired this event if continue the code that event will changed to customer.subscription.updated event Why what is the issue i made?
I'm afraid that I still don't quite understand your question.
Please see that video its only 3mins
Hey! Taking over for my colleague. Let me catch up.
The video is not clear (there is a banner)
Can you please summarize your lattest follow up question ?
If i subscribe, In webhook event customer.subscription.created event will trigger and if i cancel subscription, In webhook event customer.subscription.deleted event will trigger and if i upgrade plan, In webhook event customer.subscription.updated event will trigger but I'm changing plan by using this card 4000000000000341, In webhook event it trigger customer.subscription.pending_update_expired this event if continue the code that event will changed to customer.subscription.updated event Why what is the issue i made?
Why you want to test using that particular card ?
I'm trying to check which event will trigger when payment will failed during subscription
But for me this event will trigger customer.subscription.update_expired
There must be another event generated with this one
Could you share the Subscirption Id ?
sub_1NxqodLabf7E4J4FLPq4ZGc1
There was an event invoice.payment_failed generated before the customer.subscription.update_expired
Check this EventId: evt_1NxqogLabf7E4J4FU4VzKqR9
I have another issue if I try to update plan with this card 4000 0000 0000 0341 it will trigger customer.subscription.update_expired after click continue to run code this event is changed to customer.subscription.updated event why it changed like this
yes that's expected to get that event
What is the issue with that ?
if you don't want to listen to that event than filter/drop it from your webhook endpoint
If the payment was failed this event will trigger customer.subscription.update_expired why this event is changed to this one customer.subscription.updated
customer.subscription.update_expired
This event doesn't exist
check the list of all current available events:
https://stripe.com/docs/api/events/types
customer.subscription.update_expired there is no event like this?
no
check the list above
There is this event customer.subscription.pending_update_expired
Sorry this event "customer.subscription.pending_update_expired" will i get when the payment is failed
here i will continue the code the event customer.subscription.pending_update_expired is changed to customer.subscription.updated this event
You can get it yes
If you don't need to listen to that event, then simply ignore it
no already get this event only customer.subscription.pending_update_expired, mistakenly i will type customer.subscription.update_expired like this
Then you need to fix that typo in your code
Can you explain me breifly
What event are you missing for this Subscirption ?
No I will get customer.subscription.pending_update_expired event if I continue the code customer.subscription.pending_update_expired this event will changed to this one customer.subscription.updated
No, I'm not udnerstanding you yet sorry.
Could you answer this please ?
When the payment failed customer.subscription.pending_update_expired this event will trigger is that right or not?
There will be multiple events generated invoice.payment_failed mainly. And customer.subscription.pending_update_expired if there is a pending update on the subscription
If i update plan in local for testing purpose it will hit the breakpoint i already insert here. Did you understand this ?
Did you understand this ?
No. What you want to test ? that breakpoint is on CreatedEvent
I send mail when user subscribe, cancel plan, change plan, payment failed like this by using webhook evet API
yes
By subscribing, cancel plan, like this
I will complete my testing for Subscribe, cancel plan, update plan
Pending one is payment failed only
You can test the email functionnality regardell of what event triggerd
What you can do is to test the email sending functionality
and then call that function in each event Type
yes
But in payment failed testing it will hit the breakpoint as like other events but here when at the time of breakpoint hitting the event i will get is custo mer.subscription.pending_update_expired this one after few seconds the event will changed to this event customer.subscription.updated
else if (stripeEvent.Type == Events.CustomerSubscriptionPendingUpdateExpired)
{
var paymentMethod = stripeEvent.Data.Object as PaymentMethod;
EmailInvitations.SendSubscriptionRenewalPaymentFailedMail(userEmail, displayName, companyName, AppSetting.AppRedirectUrl);
}
i have write code like this the event will change how the mail will go to user
What you mean by the event will change ?
I can't open this
Please describe what is the issue and what you want to achieve exacly ?
You were saying there is an event changed
what is it ?
please see this one its only 1min video
If multiple event generated multiple email will sent to user
So you ned to adapt your integration to send only one email to your customer/use
But from Stripe Side, you may have multiple events at the same time
You need to adapt your itnegration (like adding an entry to a database to say that an email was already send to the customer after this Action)
Is this is the only way sort it out?
yes
ok i have another one doubt
If AutoRenewal payment was successful which event will trigger
invoice.paid