stripe / stripe-java

Java library for the Stripe API.
https://stripe.com
MIT License
825 stars 360 forks source link

Fixed raw request deserialization for v1 and v2 Api endpoints #1883

Closed prathmesh-stripe closed 1 month ago

prathmesh-stripe commented 1 month ago

Currently StripeClient.deserialize method could not parse V2 endpoints correctly. This caused a type cast exception:

class com.stripe.model.StripeRawJsonObject cannot be cast to class com.stripe.model.v2.billing.MeterEventSession

Fix involved passing ApiMode through to the deserialize function, searching the right EventDataLookup class and updating existing event deserialization calls.