How would I handle lifetime payments from customers?
You'd need to build something custom for this, since SaaS is built with a subscription in mind.
This is very similar to how I'm selling Jumpstart Pro licenses, so I can walk you through it fairly well:
I'd add a `lifetime` boolean to the Team model that keeps track.
For selling the lifetime deal, you would just use Pay to do a one-time charge: https://github.com/excid3/pay
This is very similar to how I'm selling Jumpstart Pro licenses, so I can walk you through it fairly well:
I'd add a `lifetime` boolean to the Team model that keeps track.
For selling the lifetime deal, you would just use Pay to do a one-time charge: https://github.com/excid3/pay
current_team.charge(lifetime_deal_price_in_cents)
What you'd probably need to do is just modify the `subscribed?` method on Team so that you first check if they're a lifetime customer or not.
And in the team model, you'd override it like so:
model Team def subscribed? lifetime? || super end end
Then everything would work basically the same for checking if the customer was subscribed or not.
As for the forms, you have two options:
1. Render the card form (same as the update card form) to record the card, then once a card exists, you can render the purchase form that points to the new controller action. This is what I'm doing on Jumpstart Pro.
2. Render the card form but modify them so the URL they point to the new controller action. This would keep everything in one form/step nicely but a bit more work as you need to clone the forms.
Your controller action would simply collect the payment processor chosen (stripe or briantree) from the params and the card token and assign it to the user, then make the charge, and if successful, update the team's lifetime attribute. You can see an example of how that's done in the subscriptions controller. Basically will be the same for yours except that it needs to make a charge instead of a subscribe call.
Notifications
You’re not receiving notifications from this thread.