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

Support credit against a subscription renewal #762

Closed
josephcocoa opened this issue Aug 27, 2019 · 5 comments · Fixed by #1216
Closed

Support credit against a subscription renewal #762

josephcocoa opened this issue Aug 27, 2019 · 5 comments · Fixed by #1216

Comments

@josephcocoa
Copy link

I don't know if the Stripe API supports this or not, but I have an interesting need. We are implementing a subscription site where people typically pay for their subscription with a credit card, but depending on achievements/site activity/etc, they can receive credit against their account. This credit can then be used to pay for their subscription. This is how we plan on rewarding contributors on our site (they can essentially earn free months by being awesome.)

Ideally things would work like this:

  1. Customer does some stuff on the site, they get credit added to their account.
  2. Renewal date arrives, any credit on the person's account is applied to the subscription cost.
  3. Any remaining balance is charged.

Is this something that is currently supported and I just missed it?
Is this something that could be added to this library if it isn't there already?
Is this something completely out of the scope of this library and can't be handled due to how Stripe manages subscriptions?

Before I go about building my own solution for this, I'd much rather contribute something back (if possible) to an existing library so that the community can benefit.

@Sti3bas
Copy link

Sti3bas commented Aug 27, 2019

@BinaryCocoa I think negative customer balance would be the easiest solution in your case: https://stripe.com/docs/billing/subscriptions/discounts#other

You can just update customer's balance as soon as he receives new credits:

$newBalance = $customer->asStripeCustomer()->balance + (-$credits);
$customer->updateStripeCustomer(['balance' => $newBalance]);

The negative balance will be used as a discount for the future invoices.

@driesvints driesvints changed the title [PROPOSAL] Support credit against a subscription renewal Support credit against a subscription renewal Sep 2, 2019
@driesvints
Copy link
Member

This should work just like @Sti3bas says. Maybe we can add some nice API methods to add new balance.

@ipalaus
Copy link
Contributor

ipalaus commented Dec 10, 2019

This is something I'd be interested in too. I can see this being used in sites where they offer cash against your current subscription if you bring referrals and sign up through your link.

@driesvints
Copy link
Member

I spent some time today implementing this feature: #1216

@driesvints
Copy link
Member

This will land in tomorrow's release.

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

Successfully merging a pull request may close this issue.

4 participants