stripe / stripe-java

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

Do not allow setting Stripe.stripeVersion #1909

Closed jar-stripe closed 4 days ago

jar-stripe commented 4 days ago

Why?

When we introduced beta SDKs, we allowed users to directly update the global configuration for API Version since they needed to pass beta headers in https://github.com/stripe/stripe-java/pull/1424. We soon realized that was not safe and was error prone if users didnt pass in the right format and so introduced a helper method in https://github.com/stripe/stripe-java/pull/1752 and advertised that as the right way of doing things in the README

Proper deserialization of classes from Events can be guaranteed only when the Webhook API version matches the API version used to generate the SDKs. Therefore, in this PR we are dropping the ability to directly update the API version.

What?

Changelog

jar-stripe commented 4 days ago

For the reviewer: The EventDataObjectDeserializer tests took most of the time to figure out and as a result is the part that I think could most use review to make sure we still have the same amount of coverage.