#.suryamani

1 messages · Page 1 of 1 (latest)

weary thicketBOT
gleaming wagon
#

Hi there, how can I help?

silent cosmos
#

How should i test auto renewal in local? I'm using graduation pricing table

gleaming wagon
silent cosmos
#

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

gleaming wagon
#

Can you share with me the subscription ID, and tell me what you expect vs what actually happend?

silent cosmos
#

sub_1NxqodLabf7E4J4FLPq4ZGc1

gleaming wagon
#

and what you expect vs what actually happend?

silent cosmos
#

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

gleaming wagon
#

So are you expecting the subscription to be cancelled automatically?

silent cosmos
#

no not like that im try to check which event will trigger when the payment will failed

gleaming wagon
silent cosmos
#

it shows error when i give wrong card details and payment will fail at the time in webhooks event which event will trigger

gleaming wagon
#

I'm afraid that I still struggle to understand what problem you are facing and what you want to achieve here

silent cosmos
#

see this you understand what i trying

gleaming wagon
#

I'm unable to open this file in my Mac

silent cosmos
gleaming wagon
#

No access

gleaming wagon
#

I'm afraid that discord is busy now and I don't have time to watch the video

silent cosmos
#

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?

gleaming wagon
#

I'm afraid that I still don't quite understand your question.

silent cosmos
#

Please see that video its only 3mins

weary thicketBOT
edgy schooner
#

Hey! Taking over for my colleague. Let me catch up.

silent cosmos
#

Please see this video then you will understand what I'm facing

edgy schooner
#

The video is not clear (there is a banner)

#

Can you please summarize your lattest follow up question ?

silent cosmos
#

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?

edgy schooner
#

Why you want to test using that particular card ?

silent cosmos
#

I'm trying to check which event will trigger when payment will failed during subscription

edgy schooner
#

it will generates invoice.payment_failed

silent cosmos
#

But for me this event will trigger customer.subscription.update_expired

edgy schooner
#

There must be another event generated with this one

#

Could you share the Subscirption Id ?

silent cosmos
#

sub_1NxqodLabf7E4J4FLPq4ZGc1

edgy schooner
#

There was an event invoice.payment_failed generated before the customer.subscription.update_expired

#

Check this EventId: evt_1NxqogLabf7E4J4FU4VzKqR9

silent cosmos
#

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

edgy schooner
#

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

silent cosmos
#

If the payment was failed this event will trigger customer.subscription.update_expired why this event is changed to this one customer.subscription.updated

edgy schooner
#

customer.subscription.update_expired
This event doesn't exist

silent cosmos
#

customer.subscription.update_expired there is no event like this?

edgy schooner
#

no

#

check the list above

#

There is this event customer.subscription.pending_update_expired

silent cosmos
#

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

edgy schooner
#

If you don't need to listen to that event, then simply ignore it

silent cosmos
#

no already get this event only customer.subscription.pending_update_expired, mistakenly i will type customer.subscription.update_expired like this

edgy schooner
#

Then you need to fix that typo in your code

silent cosmos
#

Can you explain me breifly

edgy schooner
#

What exactly is not clear

#

sorry I'm not understanding you

edgy schooner
silent cosmos
#

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

edgy schooner
#

No, I'm not udnerstanding you yet sorry.

edgy schooner
silent cosmos
#

When the payment failed customer.subscription.pending_update_expired this event will trigger is that right or not?

edgy schooner
#

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

silent cosmos
#

If i update plan in local for testing purpose it will hit the breakpoint i already insert here. Did you understand this ?

edgy schooner
#

Did you understand this ?
No. What you want to test ? that breakpoint is on CreatedEvent

silent cosmos
#

I send mail when user subscribe, cancel plan, change plan, payment failed like this by using webhook evet API

edgy schooner
#

ok

#

and you want to test this feature ?

silent cosmos
#

yes

#

By subscribing, cancel plan, like this

#

I will complete my testing for Subscribe, cancel plan, update plan

#

Pending one is payment failed only

edgy schooner
#

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

silent cosmos
#

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

edgy schooner
#

You are receiving multiple events in at the same times

#

and that's normal

silent cosmos
#

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

edgy schooner
#

What you mean by the event will change ?

silent cosmos
#

See this one you will understand the issue i have faced

edgy schooner
#

I can't open this

edgy schooner
#

Please describe what is the issue and what you want to achieve exacly ?

#

You were saying there is an event changed

#

what is it ?

silent cosmos
#

please see this one its only 1min video

edgy schooner
#

Keep in mind you may have multiple events generated

#

It's not opening

silent cosmos
#

If multiple event generated multiple email will sent to user

edgy schooner
#

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

silent cosmos
#

yes based on the activity of user

#

yes how will i sort it out

edgy schooner
#

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)

silent cosmos
#

Is this is the only way sort it out?

edgy schooner
#

yes

silent cosmos
#

ok i have another one doubt

#

If AutoRenewal payment was successful which event will trigger

edgy schooner
#

This guide have all details about which event is triggered for each use case

silent cosmos
#

ok

#

Thank you so much for your cooperation