-
Notifications
You must be signed in to change notification settings - Fork 850
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
Added proration behavior constants #1050
Conversation
@nickdnk Thanks for submitting! The stripe-php is now automatically generated from our openapi spec so we will have to make some changes internally before we can merge the change which will take a bit of time but I'll flag! |
I thought this was only for phpdocs, but okay sure. No rush. |
No the entire library is not automatically generated so every class, methods and constants now come from the openapi spec! |
Do you accept PRs in the OpenAPI document then? 😬 |
|
Well, yes and no. Generating libraries in multiple languages from one OpenAPI doc would serve a purpose, but generating it from code is obviously the best solution. It was more of a joke anyway. I suppose "my work here is done" then. Or do you still want PRs such as these to bring stuff to attention? |
@nickdnk We definitely still accept your PRs and someone internally has made the changes to match your PR right now so that we can merge it soon. You can also file an issue instead to ask for extra constants that you want if you don't want to do the PR and we would do it for you! While we do constants, we mostly matched what you had already done! Constants are still dangerous since they can disappear/change in API versions and the stripe-php library supports all API versions. In practice it'd mean losing constants in minor version (which we don't want) or releasing a major each time we remove a constant (which is costly). For that reason, we don't generate constants for every single enum values today though we likely will in the future! (summary: please keep the PRs coming if you're willing :) |
Okay. I'd make the case that PHPDoc and deprecation notices should be able to clear up any problems with constants. If you upgrade your API version on Stripe and this has a breaking change of an enumerated value, I'd expect any serious developer to check their code and make the necessary changes, updating the Stripe PHP library in the process. But I also know we don't live in a perfect world. I like constants because it makes it easier to find uses of enumerated values when refactoring code while avoiding bugs due to typos. |
Merging this! Thanks so for the contribution @nickdnk. I've confirmed that |
Released in 7.65.0. |
Hello
I just added some constants that I couldn't find anywhere. I'd say these belong on Subscription, but a case could be made for SubscriptionSchedule as well.