3 ms·
I'll throw in one vote for writing your own billing system if possible. It doesn't have to be complex if you're not dealing with an existing legacy system or re
by dangrossman 10y ago
I'll throw in one vote for writing your own billing system if possible. It doesn't have to be complex if you're not dealing with an existing legacy system or regulated industry. I process over $500K/year of SaaS subscriptions with basically just this:
* An accounts table with a paid_through column to identify when each person should next be billed
* A payments table into which you insert one row per payment for accounting/metrics
* A website form that submits to https://spreedly.com/ https://spreedly.com/ to tokenize payment information; the token is all you store
* A 100-line cron job that selects all the accounts whose paid_through date is in the past, then charges their subscription against their payment token, sends receipts or dunning mails depending on whether the charge went through, and updates the paid_through dates
Coupons, discounts, etc can be accommodated just by adding some columns and tweaking the billing script's SQL query. The payments table is sufficient information to calculate all the valuable SaaS metrics from your database as well -- CLTV, MRR/ARR, churn rate, etc.
Integrating with Spreedly instead of directly with a payment provider means you can change processors without changing any code -- your choice of payment processor becomes just another token.
- chris_va 10y agoWhat happens if the script dies after charging, before updating paid_through?
- dangrossman 10y agoThat's never happened in 12 years, but if it did, one of two things: (1) I'd notice that I got fewer payment receipts than I expected that day, and go fix it by updating their paid_through date in the database. You'd be able to log in to your payment processing account to see whether the charge went through or not, so there's nothing unrecoverable about this situation. (2) That customer would notice first, send an e-mail, and I'd have to apologize before fixing it. Not a very concerning situation. I'd be much more concerned about, say, vendor lock-in with an external billing provider that could terminate service or change terms on a moment's notice. Like all the "PayPal/Stripe froze our account" horror stories, or when Recurly dramatically increased their prices without grandfathering anyone in early in their history. No such concerns when you own the billing code, and don't store your customer info only with your current payment processor.