Skip to content
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

invoice() method of subscription creates empty invoice #1680

Closed
bbprojectnet opened this issue Jun 6, 2024 · 5 comments
Closed

invoice() method of subscription creates empty invoice #1680

bbprojectnet opened this issue Jun 6, 2024 · 5 comments
Assignees

Comments

@bbprojectnet
Copy link

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

  1. Create subscription with metered price.
  2. Add some usage.
  3. Invoke invoice() method of subscription.

Result: empty invoice was created, the user's balance has not changed (it has not been paid).

@driesvints
Copy link
Member

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"

@sundra-maggi
Copy link

sundra-maggi commented Jul 3, 2024

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.

@driesvints
Copy link
Member

I need a repo to reproduce this otherwise it's gonna be hard for me to recreate this.

@sundra-maggi
Copy link

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.

@driesvints
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants