#r.soares
1 messages · Page 1 of 1 (latest)
Hi there!
Yellow
For example, how would i distinguish what changed in evt_1NaxotK9PS1qRjzzyPaMaSWf vs evt_1NaxvHK9PS1qRjzztw6axz2g
Thanks! Give me a few minutes to look into this.
Hey! Taking over for my colleague. Let me catch up.
Ok
One option is to fetch the subscription after each event and check the previous state (you can keep tracking of that in your integration/database)
That doesnt help much has theres multiple things that could have changed..
Is there any way to track an SubscriptionItem added to subscription ?
Did you tried to track customer.subscription.updated:
https://stripe.com/docs/api/events/types#event_types-customer.subscription.updated
Yes, but where do i see if a item was added, removed etc ??
If it was a plan change or a qnt change ?
I think in the previous_attributes attribute section.
So what you trying to not say is a need to verify every single parameter there to compare it with current subscription ??
When a subscrition was updated we just assinged the new values to our database, now because we are adding more products to a subscription that messes up things has theres no indication what was updated
that's what previous_attributes is for https://stripe.com/docs/api/events/object#event_object-data-previous_attributes
Yeah, that all made sense when there wasnt SubscriptionItems...
Is there any plans to exanpand the webhooks for SubscriptionItems ?
not sure what you mean, the items are in the items field of the Subscription object and customer.subscription.updated happens if any of entries in that array changes
well maybe because when creating a subscription item the id returned wont be the same added if pending_if_incomplete is used makes it hard to know what is what in previous_attributes
and since pending_updates doesnt really give any information on what was updated im a bit lost...
and all this is happening because subscriptionItems->create doesnt support off_session parameter...
not understanding your specific problem, try to be more crisp about it. I don't know what it would mean for a SubscriptionItem to be off_session, those concepts seem completely orthogonal.
Arent you familiar with the off_session parameter in subscription create/update ???
I most certainly am.
So what is orthogonal about it ???
it controls if the payment that's triggered by creating or updating the subscription will be processed off session for the purposes of things like 3DS exemptions
it seems orthoganal because I didn't think adding a SubscriptionItem can trigger a payment, perhaps I'm wrong then
Maybe you are, need a minute to check ??
if I am, then I woudl say use the Update Subscription API, and update the items field, instead, and write to support to explain the use case and feature request
I'm good. What's your question/blocker right now?
My blocker right now is you trying to be a smart ass instead of trying to understand/help...
How can i track a subscription item added to a subscription ?
if an item is added it triggers customer.subscription.updated where previous_attributes shows the previous state of the items array and event.data.object.items is the current state of the items.