Here's how it's going to look like from the end user perspective:
1 hour before my PRO membership ends, if I am on a recurring plan Hummingbird will try to charge my credit card. If it succeeds everything is good. If it fails my subscription will run out and Hummingbird will try to charge my credit card again tomorrow, 3 days from now and 5 days from now. I will receive an email from Hummingbird if the charge is successful, and a different email every time charging my card fails.
If I am not on a recurring plan I will get an email 1 day before my subscription runs out urging me to get on a recurring plan.
From an implementation point of view:
We will be adding Sidetiq for recurring jobs. There will be a number of jobs to handle this logic.
- Hourly job that extends the subscription of every user whose subscription runs out in the next hour.
- Daily job that will handle credit card processing failure. It will pick up users whose subscription ran out 1 day ago, 3 days ago and 5 days ago.
- Daily job that sends an email to all PRO members who are not on a recurring plan, and whose subscription runs out in the next 24 hours.