-
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
Flexible/Metered Billing API support #460
Conversation
The failing tests also seems unrelated to the changes. Might this be a similar problem as in stripe/stripe-ruby#634 and stripe/stripe-mock#56 ? |
@alexander-stripe I think at least one of the test failures is related to your changes:
Would you mind taking a quick peek at that failing account test while you're at it? You may just have to change |
tests/Stripe/PlanTest.php
Outdated
@@ -43,6 +43,58 @@ public function testIsCreatable() | |||
$this->assertInstanceOf("Stripe\\Plan", $resource); | |||
} | |||
|
|||
public function testIsCreatableMetered() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these tests are needed -- there is already a test for the create
method and the library itself doesn't care about the request parameters, so the only thing being tested here is that the parameters provided in the tests pass stripe-mock's validation.
@brandur-stripe wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to you @ob-stripe — it doesn't hurt I guess, but agreed that it's redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not have the tests then, to keep things consistent in the test suite.
lib/UsageRecord.php
Outdated
public static function create($params = null, $options = null) | ||
{ | ||
self::_validateParams($params); | ||
$subscription_item = $params['subscription_item']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe do the same thing that you did in stripe-java? I.e. add a check and throw \Stripe\Error\InvalidRequest
exception if the parameter is missing.
4d0e8c9
to
5e0e3c7
Compare
5e0e3c7
to
67e8c4f
Compare
Feedback addressed! Pulling this in. |
Released as 6.6.0. |
Implement support for flexible billing options on plans and creating usage records.