Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow setting API Version directly on StripeConfiguration #3011

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

ramya-stripe
Copy link
Contributor

@ramya-stripe ramya-stripe commented Oct 24, 2024

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 #2561. 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 #2855 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?

  • Resolving merge conflicts coming from running the auto merge tool after Update webhook API version validation #3010
  • Make the setter on StripeConfiguration.ApiVersion private
  • Remove tests that tested the setting of StripeConfiguration.ApiVersion

Changelog

  • StripeConfiguration.ApiVersion is no longer settable. If you were using this to set the beta headers, use the helper method StripeConfiguration.AddBetaVersion() instead.

xavdid-stripe and others added 3 commits October 18, 2024 11:42
implemented IsCompatibleApiVersion to check the release identifier of the event's api version against the SDK's current version or return false if the event api version does not have a release identifier
@ramya-stripe ramya-stripe changed the title Ramya/merge dotnet beta Do not allow setting API Version directly on StripeConfiguration Oct 24, 2024
removed separate private apiVersion variable and simplified ApiVersion property
@ramya-stripe ramya-stripe merged commit be6cad3 into beta Oct 25, 2024
3 of 4 checks passed
@ramya-stripe ramya-stripe deleted the ramya/merge-dotnet-beta branch October 25, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants