-
Notifications
You must be signed in to change notification settings - Fork 679
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
Add support for new Event Meters #1698
Conversation
I see the CI has failed but for some reason, I cannot see why, it shows a generic "blocked" message, is it some geo-restriction? |
I managed to access it with a VPN, all style issues have been fixed |
Can you remove all of your idea settings from this PR? Thanks! |
Ah yes, sorry about that I thought they'd be in the .gitignore! |
done @driesvints |
@driesvints Do you need me to delete them from the previous commit history too? |
@Bark-fa no that's okay. This PR will get squashed anyway. |
Hello @driesvints, I'm reaching out because I noticed the PR is still in draft, I know you must be very busy, so if the PR needs any more work or if I missed anything in the docs please let me know and I'll gladly take it off your hands, I've got plenty of time this week. Thanks! |
@Bark-fa sorry, needed a bit to have a thorough look here. I completely refactored all of this to be on a new trait on the billable. It's not needed for usage based billing to live closely to a subscription or subscription item. I've revised the API's and simplified things. The downside of this is that the written tests aren't applicable anymore. Could you rewrite those into a new |
Done, I refactored the new tests into Let me know if anything else comes up, thank you so much! |
And regarding the new trait, I agree it's a better approach, I didn't allow myself the freedom to create new files though so I just wrote the functions where the old (now deprecated) code was 😅 |
Done. Thanks a bunch for this one @Bark-fa. Would also highly appreciate a PR to the docs! |
Hello @driesvints, you're very much welcome, I just submitted a PR for the docs |
@Bark-fa did you try these tests? Because they're failing atm. |
Hello @driesvints, what tests specifically? I tried all the tests I wrote, and the old ones as well, and all ran with success, which ones are failing? |
I just checked, I think the problem was caused by this line: This used to be in the Subscription class, so the logic was that if the user did not provide a start time, we'd set it to the date the subscription was created, but when it was moved to a trait, $this references the User model, this should fix it: I pushed it to my fork |
Can you send in a PR? Thanks! |
Of course, on it |
This reverts commit e93c299.
Hello! This PR adds support for the new event meters by stripe for tracking usage in usage-based subscriptions, this is my first time contributing to cashier, and I've made every effort to maintain the style and naming conventions, and everything is fully typed, please let me know if I missed something either in the code itself or the tests.
Thank you so much for your time and effort.