-
Notifications
You must be signed in to change notification settings - Fork 682
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
[12.x] Metered billing #1048
[12.x] Metered billing #1048
Conversation
This fixes any issues where exceptions are not handled
665e353
to
d5ef0c5
Compare
ea47e7c
to
8657b69
Compare
afd5c35
to
5e1df09
Compare
@benjamindoe I'm finally done with the PR! Can you give it a review? |
$item['deleted'] = true; | ||
|
||
if ($plan->usage_type == 'metered') { | ||
$item['clear_usage'] = true; |
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.
What does this do?
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.
Clearing usage for a metered plan is required when the plan is deleted. Stripe has noted that this param will probably be removed in the future and the behavior would be the default.
This PR adds support for Metered Billing. Thanks to @benjamindoe
Closes #555
Usage
Subscribe user to metered plan:
Reporting usage from the subscription:
Reporting usage from a subscription item:
Stripe gives you the ability to update a usage record at a particular timestamp. The
reportUsage
&reportUsageFor
methods accept a Carbon object to specify the timestamp:Todos
Related Stripe Documentation