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.
@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.
This should work just like @Sti3bas says. Maybe we can add some nice API methods to add new balance.
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.
Most helpful comment
This should work just like @Sti3bas says. Maybe we can add some nice API methods to add new balance.