Closed bbprojectnet closed 1 month ago
Hi @bbprojectnet, sorry I kind of lost track of this one. Could you provide me with a repo to reproduce this?
laravel new bug-report --github="--public"
I'm having this exact same issue, it looks like metered subscriptions do not get charged for usage when either calling invoice() or swapAndInvoice(). Current workaround is accessing the stripe client directly.
I need a repo to reproduce this otherwise it's gonna be hard for me to recreate this.
There is literally nothing fancy here.
Create a Stripe Product with any type of metered billing. Subscribe a user to said subscription product. Add usage to said subscription. Run invoice() or swapAndInvoice() and note how the invoice generated does not include charges for usage.
I'd drop my repo here but it's corporate so I can't. However, if I do find the time to do so I'll throw together a quick example for you.
Managed to reproduce this but this unfortunately isn't a Cashier issue. We simple implement the way the API's work. There is a reason why this isn't invoicing the metered usage on an existing subscription but I can't find anything in the legacy docs that would hint at what's wrong.
For this, I kindly redirect you to Stripe Support. Please do let me know if you find the exact reason so we might update Cashier with a solution. Thanks
Cashier Stripe Version
15.2
Laravel Version
11
PHP Version
8.3.7
Database Driver & Version
PostgreSQL 16
Description
As described in the method invoice() of subscription: "Invoice the subscription outside of the regular billing cycle." should generate new invoice in the middle of cycle. Unfortunately, the invoice is for 0.00 despite a different balance on the upcoming invoice.
Maybe I misunderstand the intention of this method, but is there a way to invoice during the cycle and thus reset it?
Steps To Reproduce
Result: empty invoice was created, the user's balance has not changed (it has not been paid).