5 ms·
I wrote the billing system for onehub.com, and we had to deal with each issue mentioned in this article. ActiveSupport makes some of the date problems melt away
by texel 17y ago
I wrote the billing system for onehub.com, and we had to deal with each issue mentioned in this article. ActiveSupport makes some of the date problems melt away, but we ended up implementing pro-rated upgrades and downgrades, free trials, and discounts.
There are some super fun edge cases:
- Handling the case when someone upgrades or downgrades after we've billed three days in advance for the next month's service
- Handling the case when someone downgrades during a free trial (you don't want to pro-rate money back to their account that they never paid in the first place)
If I had to do it all over again, I would probably use one of the services that handles this exclusively. Unfortunately, when we started out, none were available.