#tymm
1 messages · Page 1 of 1 (latest)
Hi, could you elaborate?
i have updated a subscription, changing the amount of the product from 2 to 1
is it safe to assume the value data.previous_attributes.quantity is always available and reflects the quantity before the update, and
data.object.quantity is also always available and reflects the updated quantity?
assuming that i call to the update api to update the amount of one product in one subscription at a time
Yes! That's the purpose of previous_attributes
in java, based on the structure of the event object received, i get deprecated warning when trying to access event.getData().getObject() what should i use instead?
by using this i assume u want me to cast that to com.stripe.model.Subscription? if yes, the quantity field will be buried and nested deep in the object. i just want a quick and reliable way to get the data i need
by using this i assume u want me to cast that to com.stripe.model.Subscription?
yes, that's how you can fetch the nested values
how do i access data.object.quantity based on the event object, in the Subscription object?
Could you please share the eventId of that event payload?
Between, if you don't like to use Stripe object, you can parse that json object using Gson/Jackson and get that field data.object.quantity
evt_1NZqbeLouXJU4FDJTCwiKkL6
Thanks for sharing, yes you can use the Gson/Jackson approach in order to access directly to the field.