#akashpatil7596_webhooks

1 messages ยท Page 1 of 1 (latest)

night deltaBOT
#

๐Ÿ‘‹ 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/1226871628516950036

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

tepid badgerBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

cerulean locust
#

๐Ÿ‘‹ happy to help

fading token
#

Hi

#

You understand my question?

cerulean locust
#

yes I think so

#

you want to know what changed after the subscription update right?

#

in the event you have the previous_attributes property

#

that shows you what are the values that are being changed and what were they

cerulean locust
#

what do you mean?

#

would you mind sharing an event ID

fading token
#

evt_1P3HPiIoZDVxPDheRPhwsM86

cerulean locust
#

that's customer.updated

#

not customer.subscription.updated

fading token
#

Sorry , evt_1P3HPiIoZDVxPDheAIgRgfcO

#

Can I send some metadata Or something only when customer update their card?

cerulean locust
#

but all .updated events have the previous_attributes

#

no you can't modify the event

#

you need to look at the previous_attributes and if the default_payment_method has changed then you know

fading token
#

I just want to get some difference in subscription plan upgrade/downgrade And payment method update

cerulean locust
#

I'm telling you how to get it

fading token
cerulean locust
#

not previous_attempt

#

previous_attributes

#

yes there is and you can see it on your dashboard

fading token
#

Yes yes that

cerulean locust
fading token
#

Ok got it

#

now?

cerulean locust
#

what's the question?

fading token
#

Where can I get the diff? subscription plan upgrade/downgrade And payment method update?

tepid badgerBOT
fading token
#

Hi

gilded totem
#

Hi there ๐Ÿ‘‹ I'm taking over as my teammate needed to step away. I understand you have a question about finding the difference between two values/states. Can you tell me a bit more about that and what you're asking about?

fading token
#

customer.subscription.updated event called on these 2 case
If a customer upghrade/downgrade subscription Plan
if a customer update thier payment method

I need to differentiate between two methods, So I can do 2 various operations

#

You got it ? @gilded totem

gilded totem
#

Sorry, I was working another user. Please refrain from trying to ping our team members, it typically distracts us and slows us down rather than helping us get to you quicker.

It sounds like you're looking for the data.previous_attributes hash within the Event object you receive. It allows you to see the previous value of the fields that changed, so you can tell exactly what changed and take the appropriate action:
https://docs.stripe.com/api/events/object#event_object-data-previous_attributes

fading token
#

Sorry, But Where Can I find the change of value ?

gilded totem
#

You compare what is in data.previous_attributes to what is in data.object.

fading token
#

Okay

#

I'll try

#

No can't find anything

gilded totem
#

Can you give a lot more details?

fading token
#

Like what?

gilded totem
#

What did you see in the Events, what were you looking for?

#

What Event were you looking at?

fading token
#

When I'm updating My payment method , In customer.subscription.update I need to verify that this event is Only for updating payment method and not upgrading/downgrading subscription

gilded totem
#

What do you see in the Event after you make the change?

fading token
#

data.Object

#

data.previous_attributes

gilded totem
#

What did you see in those?

#

Taking a step back, when you say you're updating your payment method, is that updating the default_payment_method field on a Subscription object? Otherwise the change likely isn't generating a customer.subscription.updated Event for you to hook on.