It is always easier to tear down than to create. I don’t consider myself a negative person, but I’ve done some complaining on this blog. I’d like to change course on that.
Today, I was implementing Stripe for the second time (once before on Moss and now on Sirepo). I have to say that each time has been a pleasure.
Good Docs
Like, seriously good docs. Like someone deeply thought about them. And then someone else did a really thorough review. And then someone else diligently kept them up to date. And then someone listened to developers and added more docs for specific things that were causing people confusion.
Documentation like this is not easy to make. It is a whole job function and can’t just be tacked on after the fact. I’m really grateful for their work.
A prime example is the first docs you’ll probably come across: the quickstart. They have major frameworks/languages ready to go. They also have raw HTML as an escape hatch (we use AngularJS, so I started with the basic HTML docs and adapted). These docs are thoughtfully written. They cover enough of the initial use case to be useful. It is a fine line in quickstarts to balance useless toy “hello world” examples vs. information overload, and they nailed it.
CLI to Make Testing Easy
At Moss, we haven’t yet implemented handling webhook events. On Sirepo, we are going to want to handle them out of the gate. When I was building the plan for implementing Stripe in Sirepo, I set aside extra time for developing/testing the webhook. With other tools, testing webhooks can be a pain. They don’t have a good way to trigger events in development to easily test. Not the case with Stripe.
First, one needs to install the CLI. They have that covered in spades. They handle all major OSs/distros (and then some). And it is just a painless process. Getting the RPM for Fedora and installing it took me 30 seconds.
The CLI has a local listener, so you can easily forward real webhooks to your development server running on localhost. No ngrok or socat needed here. Just a simple tool that does exactly what so many systems like it need.
Finally, you can trigger any event. They make this dead simple (also a consequence of their good API design).
I had set aside half a day for hacking up some testing of the different webhook events we are going to need to handle. In the end, I spent only about an hour implementing and testing. That is a huge gain and is thanks to the work Stripe has done to make developers’ lives easier.
Bugs
I was cutting a release one night for Moss and ran into a bug caused by the Stripe Python SDK. Stripe was quick to fix it. My only slight comment is that for a regression like that, one should add a test. But we can’t all be perfect all the time. :)
Thank you, Stripe! You’ve saved me time and made your product easy to integrate. Please take my money!