How to implement hourly billing in a SaaS application?
I'm working on a SaaS application with NodeJS. Its pricing model is similar to DigitalOcean's. Each user in my app has a balance. They will add credit to their balance before subscribing to plans.
I want to implement a cronjob, maybe with Agenda, to check the status of subscriptions, every minute and then decrease the balance.
Is my approach correct or not? What are the best practices?