
Cheap Recurring Payments with Stripe and AWS Lambda - sl8r
http://normal-extensions.com/2017/05/05/simple-recurring/
======
stevekemp
Remember that if you use stripe subscriptions you absolutely __must __setup a
webhook, or otherwise examine your logs every month.

Why? If a customer is subscribed to a "plan", and their payment fails it is
retried three days later, then five days later, then eight days later, and if
all three payments fail they're quietly unsubscribed without any notification
being sent to you!

I have a toy project which has paying customers and last month realized I'd
had people using my SaaS for over a year without having paid me. A few
failures in a row meant they were unsubscribed, and since I didn't read the
reports every month I didn't notice.

I reworked my payment system now, to subscribe to webhooks and ensure I find
out promptly in the future.

Not a huge deal at my volume, but a surprise I could have lived without.

~~~
olegkikin
Out of curiosity, did any of these customers return?

~~~
stevekemp
I had three users who were really affected, and all of them paid up. None of
them "left" really, they were receiving a service from me, just not paying for
it.

The user who had a years free service I wrote down a little - they should have
paid around £140, and I suggested we'd be good if they paid £100.

Perhaps I went too easy on them, but I was trying to be nice and it wasn't
their fault I'd not been paid, not directly. The other couple of users ranged
from 2-8 months of non-payment, or so, and I agreed with each that I'd bill
them the full amount as a one-off charge.

------
oliwarner
~3%, dirt cheap?!

Why are so many of you so happy to throw so much cash away to process money? I
_know_ Stripe is lovely to integrate but as a business you have to shop
around.

In the UK (and EU) card processing is much cheaper. Stripe is closer to 2% but
if you shop around, you'll find somebody who'll offer you 0.8-0.9%, give you
free terminals and no monthly contract fees.

Edit for those asking: Worldpay and Handepay are the best rates I've seen
recently. Both for online and off. But again, don't just cluster around one
company, harass a few yourself. They're willing to compete.

~~~
Androider
Stripe has an extensive ecosystem of services that integrates with it,
literally hundreds ([https://stripe.com/works-with](https://stripe.com/works-
with)).

The services I need to run the back-office operations of my business including
bookkeeping, invoicing, receipts, business metrics, customer support etc. all
use Stripe data and APIs. Writing our own integrations, or worse, trying to
poorly replicate some third party service, would be money poorly spent. It
would take a very large transaction volume for it to make any sense to spend
engineering time here, and arguably the end result will be qualitatively worse
than just going with the market leader. Even if that calculation does come out
positive, you still have to consider whether the engineering time wouldn't
provide an even higher ROI by being invested into your core product instead.

~~~
debaserab2
Integrating with a merchant payment gateway isn't rocket science. A few weeks
is easily worth the cost (it doesn't take that long, either, most have decent
enough APIs or SDKs that may not be stripe quality but still are simple to
integrate with).

It doesn't take a large transaction volume to justify the engineering cost at
all. We're talking entire percentages of revenue. The ROI justification is
going to be a hard one to beat in this case.

~~~
Androider
The point was that there are N other services you use when running a
subscription service, that all integrate out of the box with Stripe and not at
all with the cheaper alternative.

------
mherrmann
It's unbelievable how easy this is with Stripe in comparison to PayPal. I had
to do the latter a week ago and it was horrible [1]. It's no wonder Stripe is
so successful.

[1]: [https://fman.io/blog/paypal-for-
saas-99-problems/](https://fman.io/blog/paypal-for-saas-99-problems/)

~~~
PetahNZ
Isn't that why they made Braintree

~~~
venning
Not sure if you're implying that PayPal "made Braintree" or just that someone
made it, but PayPal didn't acquire Braintree until 2013, after being founded
in 2007 [1].

[1]
[https://en.wikipedia.org/wiki/Braintree_(company)](https://en.wikipedia.org/wiki/Braintree_\(company\))

------
l5870uoo9y
Stripe charges 2.9% + $0.30 per transaction, the others mentioned have a
monthly fee and then lower transaction fees. So Stripe isn't remarkably cheap.

~~~
jhall1468
Depends. Developing intregrations has a cost, and until you're processing
enough to offset the difference, using something other than Stripe is bad
business.

------
PaulRobinson
This is what people are missing on Lambda. It's pay-to-play, and for 90% of
the sites out there, they're paying too much in comparison.

If you're running server instances 24x7 for an application that is doing < 25
requests/minute on average, you would probably find your hosting costs come
down (perhaps to zero) and your reliability would increase considerably if you
moved to Lambda-style applications.

serverless.io is a decent framework to get started (allows for local dev and
testing, manages deployment) and is agnostic in terms of deployment target:
AWS, IBM, Google coming soon, etc.

The only reason we're not rolling it out everywhere at work is because it
assumes all developers are deploying directly from their term with god-like
CloudFormation access. Nope, nope, nooope. We just need to build the deploy
pipeline for it, and then off we go.

~~~
jjeaff
But are they really paying too much? I can't think of a lot of products out
there, especially those that have a recurring subscription, that don't
required some sort of database. So you need a server running a database
anyway. It seems that the subscription logic would be a very negligible
addition to the instance you have to be running anyway.

To me it seems like the only sweet spot for lambda on a large scale would be
for those that have consistent usage of a small instance that have some extra
functions that need to be highly scalable and are very inconsistent.

~~~
PaulRobinson
There are multiple alternatives to running your own DB service, and again, all
pay-per-use.

In the original article the author suggested on a successful subscription a
write to the MailChimp API (because that's the product). In that example,
MailChimp is the DB. You don't have to run a copy of a DB locally if you
architect things like that. Obviously if the call fails, you need to think
about what you fall back to, which is why error handling is such a critical
piece of the the Lambda ecosystem - as it should be for every ecosystem,
really.

~~~
lsaferite
In this case you should really just dump the subscription on a queue (SQS) and
process the payment to mailchimp on a different thread that can deal with
errors.

------
Mojah
I've been using Laravel Spark [1] for recurring payments built on top of
Stripe, and at a 100$ one-time fee for Spark and a small server setup (that I
needed for the service in the first place) I think it's a cheap option for
recurring payments, too.

[1] [https://spark.laravel.com/](https://spark.laravel.com/)

~~~
aantix
I did something similar with aMember a few years back. Supports many payment
processors; a one time fee. API, etc.
[https://www.amember.com/](https://www.amember.com/)

------
fenesiistvan
The problem is that Stripe is still not usable in the half of the world,
including my country, Romania.

~~~
neximo64
You can use Atlas cant you?

~~~
mrunkel
What is Atlas in this context?

~~~
klausjensen
Stripe's offering to set up a company in the US, with bank accounts and
everything.

[https://stripe.com/atlas](https://stripe.com/atlas)

~~~
mrunkel
Ahh. thanks. I googled for Atlas, but as you can imagine, lots of things came
up..

------
ctcliff
I maintain a small open source library for managing payments websites that
uses this architecture [1]. My Lambda costs have been about $0.04 per
transaction.

Also you can provision AWS from the browser using a CloudFormation template
and a Launch Stack URL [2].

[1]:
[https://github.com/christophercliff/flatmarket](https://github.com/christophercliff/flatmarket).
[2]: [https://github.com/christophercliff/flatmarket#automated-
dep...](https://github.com/christophercliff/flatmarket#automated-deployments)

------
cpt_snowcrash
I never got around getting the true value prop of recurring solutions such as
chargebee etc when used on top of stripe. Stripe already provides excellent
recurring subscription payments api out of the box, so why use any of these
services. Am I missing something ?

~~~
keerthiko
We transitioned from Stripe to Chargebee importing our Stripe stuff. It was a
solid 2 man-months of engineering (of our 4-person company) and we questioned
the cost through the process, but it has really paid off. Stripe was a great
starting point for us to collect direct payments, but as we grew Chargebee has
proven very worthwhile.

The main value is central customer and subscription database, which muxes
multiple payment methods: Credit Card (via Stripe), Amazon payments, and
Paypal. This alone has doubled our monthly paying customer growth.

Next it allows us to create invoices, subscriptions and customers data to put
in the same database for customers from other channels -- mostly this is our
iOS users who have to subscribe via iTunes (due to Apple TOS) -- now we can
manage their data in the same place.

It is also an integrated coupon management system, hosts custom styled
payment/subscription management pages (as opposed to just a tiny payment
widget like Stripe), supports more flexibility like trial periods, switching
between subscription plans, adding credits to a user's account.

We've moved all our non-iOS customers to Chargebee for about 6 months now, and
really happy with it.

~~~
robinjfisher
Have you done any formal ROI on the move to Chargebee?

I moved from Chargify to Stripe about a year ago (to save on cost) and the
biggest challenge was getting customers to re-enter their card details for
Stripe.

I offered a coupon for 50% off a month's subscription to entice them to do so
but still resulted in a couple of months of paying both Chargify and Stripe
while I chased the errant customers.

~~~
keerthiko
Chargebee had a one-time free customer database import process from Stripe,
does Chargify/Stripe not support any kind of customer import/transfer?

I can't give numbers for our ROI, but we spend far less time providing
payment/subscription support, and pay a flat extra cost to Chargebee for the
added abstraction layer they provide so it's easy to evaluate -- worth roughly
100 subscribers/month, and since shifting to Chargebee we gained more than
that number within the first month beyond our regular month/month growth.

------
ajainy
Thanks for article. Though I known about Lambda for long time, but this is one
nice example, how Lambda can be used. Now I am planning to use to develop some
zapier like integrations.

-=-=

Having said that, before you jump into making free payment forms for your
static site, keep PCI compliance in mind. (even if stripe is rendering form
using js).

------
bigtunacan
I've seen several comments on here about how high a percentage is being
charged by credit card processors and this is something I've wondered about
for a while. There are some sites where I feel like I must be missing
something.

As an example;
[https://www.sendmoneytoschool.com](https://www.sendmoneytoschool.com).

The site is used to pay online with a credit card for your children's school
lunch and it typically charges a $1.50 "convenience fee". It is my
understanding that they are not charging schools for the use of this service
(I may be mistaken); at Stripe or PayPals fee rates this service would be
losing money. Every $100 would incur at least a $2.00 fee. Here a low cost
processor like Worldpay and Handepay would allow for a profit; albeit a very
small one.

------
floodfx
This is pretty cool but to be pedantic this is actually API Gateway proxying
requests to AWS Lambda not just a Lambda function. Zappa and other Serverless
Frameworks sort of obfuscate the fact that API Gateway is setup in front of
Lambda but that is what is happening here. Again, cool example.

------
likelynew
I can see many cases where there is need for more control. Yes, we can start
and end manually, but is it acceptable to be that flaky with payments. I mean,
I have managed my personal server in pretty ad-hoc way and more often than I
expected there are some problems with something. I don't think I can trust
myself with lambda.

------
dheera
Now if only my property manager could get with the beat and take electronic
payments ... I still have to bike over to their office and drop off a physical
check every month because they don't take anything else.

~~~
ferentchak
Can you use bill pay from your bank?

~~~
dheera
I think so, but it requires me to call them to set up, I hate calling and
being put on hold.

And also, phone calling usually involves walking out to the street so I can
get reception, yell my social security number in front of a bunch of strangers
walking by, and somehow verify my account number and various transactions from
my account which I can't do without going back inside, logging in from a
computer and checking them, and then having the call dropped because I went
inside. Or having my phone battery cop out halfway through being put on hold.

I _hate_ phone calling. It's easier to bike to my property manager's office 12
times to drop off checks than make a single phone call to my bank to set up
something that should be doable from a web page.

~~~
clintonb
Most banks allow you to setup bill pay online. The bank will mail a check on
your schedule. No need for phones.

~~~
dheera
I wish. Both of my banks bring up messages saying to call customer service
when I click on their respective Bill Pay links. So much for "online" banking.
We're back in the 80's.

------
Denzel
This is simple and cool.

You'd still need some way to authorize subscribers on your website, no?
Therefore, you couldn't create a serverless subscription blog/website...
unless I'm missing something.

~~~
robinjfisher
The example given in the article is a pay-to-subscribe mailing list run on
Mailchimp where you can use an API call to add the paying user to the list.

------
ousta
id rather use XRP

