#tymm

1 messages · Page 1 of 1 (latest)

velvet sentinelBOT
silk falcon
#

Hi, could you elaborate?

leaden cobalt
#

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

silk falcon
#

Yes! That's the purpose of previous_attributes

leaden cobalt
#

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?

silk falcon
#

Have you tried event.getDataObjectDeserializer()?

velvet sentinelBOT
leaden cobalt
hidden cairn
#

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

leaden cobalt
hidden cairn
#

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

leaden cobalt
hidden cairn
#

Thanks for sharing, yes you can use the Gson/Jackson approach in order to access directly to the field.