I have an application that has subscriptions simular to Laracast, Monthly, Yearly and Forever.
I have the Monthly and Yearly subscriptions working, however, I'm struggling to work out how to manage the Forever subscription. This will just be a one-time payment that allows the user to access the service forever.
How should this be set up in Stripe and managed with Cashier?
I've used charge for those kind of situations and just keep the charge reference.
Something like
class BillingService
{
public function forever(Order $order, string $token): Order
{
$payment = $order->user->charge($order->price, $token);
return OrderRepository::paid($order, $payment);
}
}
@bugsysha Thank you for that. I think this makes sense to me. If I do this as a one-off payment do I then need to manually add that user into Cashiers subscriptions table or is there a way for Cashier to handle that which I'm missing?
If you are using Billable::subscribed() to check if that model is subscribed, then just create a subscription and put ends_at to something like now()->addCentury().