-
Notifications
You must be signed in to change notification settings - Fork 432
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
Support for flexible billing and usage records #421
Conversation
bf9457c
to
be50656
Compare
Thanks! This looks good to me |
Thanks for sorting this out Olivier! I just wanted to flag that in most of our other languages, the I'm okay with it if you're comfortable though — what do you think? |
@brandur-stripe My reasoning was that if we wanted to do exactly the same thing that we did in stripe-ruby and stripe-php, we'd have to check if For the user though, it makes little difference. In nearly all cases, they'll be passing keyword arguments, e.g. calling I guess doing it this way does make it possible to pass I'm on the fence about all this, so if you think it's better, I can certainly switch to the manual exception raising pattern we've used in other libraries. |
Ah, interesting. I didn't know about that. It's kind of a similar story in Ruby — I actually got out of the habit of using required named parameters in stripe-ruby because 1.9 support was so long running. Now that I think about it though, we only support 2+, and could plausibly change Regarding Python though: what do you think about possibly making it an optional parameter that throws an error with the expectation that eventually we could change it to take advantage of PEP-3102? I know today the Python 2/3 divide seems long-standing and permanent, but the community seems to be pretty committed about 2020 being the year where from an official standpoint, Python 2 will be jettisoned into the sun. I'm still not sure that we'll be able to drop support for Python 2 then, but I think it would at least become a possibility. I don't feel too strongly about either path though, so I'll leave it up to you. |
be50656
to
668429f
Compare
@brandur-stripe Works for me. I've updated the PR so that ptal @brandur-stripe |
668429f
to
93e2e77
Compare
Amazing! LGTM. |
r? @brandur-stripe
cc @stripe/api-libraries @alexander-stripe
Since stripe-python uses keyword arguments for request parameters, I simply added
subscription_item
as a a required argument toUsageRecord.create()
.