
Stripe CLI - askytb
https://stripe.com/blog/stripe-cli
======
knubie
Stripe is by far the best developer experience I’ve had in my career working
with third party APIs/services. The attention to detail is just second to
none, and documentation is a big part of this.

~~~
IGotThroughIt
Top APIs I've enjoyed working with:

1\. Stripe (Best)

2\. Twilio

3\. Twitter (Does what it needs to do quickly)

4\. Puppeteer (Amazing. Was super helpful.)

5\. Google (mostly ok but could be better)

APIs I've hated working with:

1\. Paypal (the worst - docs are horrible and UI is not consistent with most
of the help material out there because it changes all the time. Have you tried
their support? That's a beauty)

2\. Facebook (same story but manageable compared to paypal)

~~~
smoussa
Add eBay to the second list. We are still uploading XML documents.

~~~
hobofan
And Amazon sellers API (Amazon MWS). Rarely seen such an inconsistent mess of
often poorly documented SOAP-ish calls, that so many external partners base
their livelyhood on.

~~~
etaioinshrdlu
Some APIs you can choose to use. Other APIs you have to use. The ones you have
to use tend to not care much about the developer experience... Because why
should they? No one's going to avoid Amazon because their API was annoying.
People need to make money.

This actually explains a lot of other things. Like the DMV.

------
rsync
In the Twilio world, I can do something like this, via the command line and
their API:

\- activate new phone number

\- send SMS from that number

\- deactivate number

I have not ever done _that particular workflow_ , but I could.

Who is the Twilio of payments/fintech wherein I could perform a workflow like
this:

\- generate new CC number in my name

\- set transaction limit(s) and expiry 10 days from now

\- (go use that CC in real life)

\- deactivate the CC

or maybe:

\- disable existing card

\- reenable existing card

I know I could do this if I wrote the API myself and had a big, complicated,
sticky relationship with a bank ... but does someone let me do things like
this if I am just an end-user (like Twilio does) ?

~~~
latencyloser
Privacy.com gets pretty close. They can generate burner cards or "per service"
(such as a card just for your netflix account) that have spending limits per
some period of time or in total. Their autofill plugin for firefox works
pretty well. That's the extend of my usage of the service, it might do more
but I'm not sure.

Personally, I use them for anything that doesn't accept paypal or similar
payment systems. Hopefully that's helpful.

~~~
zapita
I also use privacy.com and it’s great. The only problem is that sometimes
merchants don’t accept prepaid debit cards (that’s what privacy.com cards are
under the hood).

So far I’ve had cards rejected by Patreon and AT&T.

I still recommend privacy.com though.

~~~
woadwarrior01
Also, DigitalOcean. I'd used a prepaid debit card with them in the past, but
they don't accept them anymore.

~~~
sah2ed
Adding that prepaid debit card to your PayPal account, then paying DO with
PayPal works seamlessly.

------
zehtomer
Hi all! I'm one of the folks who's been working on this for the past few
months. I'm happy to answer some questions about the CLI or how it was built
(using Go and websockets for pushing data). If you have any ideas or feedback
feel free to email me directly too! tomer@stripe.com -- We'd love to hear how
you're using the CLI and what you'd like to see in the future.

~~~
numtel
Super minor complaint, but when I suspend/lose connection for a while and it
restores, I have to restart the CLI to resume receiving events.

~~~
zehtomer
We're looking into improving the disconnect/reconnect flow! Hopefully will
have some progress on that soon.

------
soygul
Excellent product, fast improvements, best in class API/SDK, and
documentation; this was pretty much my summary after extensive research on
payment processors. After 2 years of using Stripe, my conclusion is unchanged.

Also, an interesting coincidence that I've just released a case study of
Stripe's success and recent $35B valuation [YouTube]:
[https://www.youtube.com/watch?v=nlFAbBvu7hA](https://www.youtube.com/watch?v=nlFAbBvu7hA)

~~~
on_and_off
Fwiw, we kinda had the opposite experience when trying to get them to fix the
a11y of their product.

It has been a constant struggle on all platforms to get the stripe widgets to
behave correctly.

Since payment is not exactly an optional step in a product, this has been very
painful.

~~~
ztratar
Curious which widgets you're talking about?

~~~
on_and_off
the credit card data input widgets that stripe provides

------
SomaticPirate
Always interesting to see what CLI library is used. Looks like another feather
in the cap of
[https://github.com/spf13/cobra](https://github.com/spf13/cobra). I would love
to hear why they chose cobra over something like
[https://github.com/urfave/cli](https://github.com/urfave/cli)

------
TechTeam12
I filled a bug task on your github page, but you've got a deadlink for the
linux install in your readme.

Really excited to get to use these tools. Already integrated with stripe for
my projects, but this will allow for more cool testing. Thank you stripe team!

~~~
auchenberg
Kenneth from Stripe here. We just committed a fix. Thanks for the heads up!
[https://github.com/stripe/stripe-
cli/commit/edaa05a505e935a5...](https://github.com/stripe/stripe-
cli/commit/edaa05a505e935a53a96a9ba2290ef09192fcf16)

~~~
benburleson
Very impressive. From an engineering standpoint, Stripe knocks it out of the
park.

------
nickjj
This looks really good.

It sounds like you won't have to configure tools like ngrok anymore to accept
webhooks on a local connection. That's a huge win because with the free
version of ngrok your subdomain would change a lot which means having to goto
the Stripe dashboard to update it there. It was pretty tedious.

~~~
benologist
This is a free equivalent to ngrok and it only uses SSH -
[https://serveo.net/](https://serveo.net/) \- and it accepts custom
subdomains. I spin it up for each project like this with $DOMAIN and $PORT
being defined/fixed for each project and the connection kept open permanently
using autossh:

    
    
         ssh -R $DOMAIN:80:localhost:$PORT serveo.net
    

There are API endpoints for creating, listing and deleting webhooks in Stripe
now too - my test suites and dev instances purge any existing webhooks and
create a new one each run.

[https://stripe.com/docs/api/webhook_endpoints/create](https://stripe.com/docs/api/webhook_endpoints/create)

~~~
MuffinFlavored
Do you think there would be demand for `serveo` but instead of running your
project locally, you point to a Dockerfile and the entire container + all of
its dependencies are ran remotely (with wildcard subdomain SSL included)?

I was going to test the waters with
[https://www.dollardeploys.com/](https://www.dollardeploys.com/) (not
functional yet), wasn't sure how to differentiate it between ngrok/serveo.

~~~
benologist
I think at that point you're really into Heroku's territory rather than
ngrok/serveo. Their free dynos might be hard to compete with, you can push a
git commit or docker image or automatically deploy upon repo changes:

[https://devcenter.heroku.com/categories/deploying-with-
docke...](https://devcenter.heroku.com/categories/deploying-with-docker)

~~~
MuffinFlavored
I 100% agree which is why I decided not to pursue the idea. Thank you very
much for taking the time to provide feedback!

------
sealthedeal
Love this! We Strive everyday at Routefusion.co to model our developer
experience and attention to detail off of what Stripe has done. They turned
credit card payments sexy, not an easy thing to do, but when you have great
experiences like this and focus on a the builders of tomorrow I guess it
works!

------
skyraider
I like the attention to detail this feature reveals - in particular, how if
you're in Stripe test mode in browser tab X and type `stripe login`, the cli
will open a page in browser tab Y that gives you a test mode webhook secret,
without prompting you to select a mode again. Very intuitive.

------
yingw787
Wow, this is amazing! I was learning more about ncurses and the various UI
libraries built on top of them (e.g. Urwid). From going without Internet for a
third of this year and using 1GB of mobile data per month, I've learned there
aren't actually that many companies these days trying to serve customers with
slow/intermittent Internet or optimize for data load. And that's an
opportunity, because those customers are most likely sticky! I read that 3% of
Americans still use dial-up internet, which amounted to 9.4 million people in
2016 ([https://www.allconnect.com/blog/people-really-still-use-
dial...](https://www.allconnect.com/blog/people-really-still-use-dial-
internet-actually-9-4-million)). IIRC this is still better than the Internet
connectivity in developing countries. If you got $1 from each of those people
every year (less than 10 cents a month), you'd have $9.4m ARR, and it'd be
sticky. Sticking to curses enables issuing API requests out to the world
without having to build/download/install a GUI/XWindow server, and an entire
browser on that GUI, and an entire webpage on that browser, which may
drastically improve reach. Optimizing for legacy machines and empathizing with
such a customer base is probably a big reason why WhatsApp looked so
attractive to Facebook and why Facebook paid such a high premium to have the
platform under its product ecosystem. I'm looking forward to seeing how this
expands!

------
appstorelottery
I too salute our stripe overlords. The payments api is so easy to use - I was
done in a few hours, literally... in php (boo). :-)

------
chadlavi
This is a great improvement! Last time I did a stripe integration it was
definitely kind of a painful, disjointed experience.

~~~
MuffinFlavored
Really? It's like... 3 API calls. Create a customer, store a card, create a
charge.

~~~
ceejayoz
There's quite a bit more complexity in some use cases. Some payments are now
asynchronous due to
[https://en.wikipedia.org/wiki/Strong_customer_authentication](https://en.wikipedia.org/wiki/Strong_customer_authentication)
; handling failed payments for things like subscriptions takes some effort
(and managing webhooks).

My experience _with_ Stripe has been great, but payments can still get into
the weeds through no fault of Stripe's.

~~~
MuffinFlavored
I might sound a bit dumb here, but would a cron job that runs daily, finds
customers who haven't been billed in 30 days, then tries to bill them and
disables their account on failure easier than dealing with webhooks/etc.?

~~~
ceejayoz
Potentially, but Stripe has a lot of features you might have to duplicate in
that case. They automatically re-attempt (including machine learning that
tries to do it when the card's least likely to be maxed out). They send email
receipts, handle SCA notifications if additional authentication is required...

------
gfrangakis
Is Stripe's "documentation stack" open-source? I've seen Slate and its
derivatives, but honestly nothing really comes close to the full (amazing) dev
experience their docs provide.

------
SalesDevRep
Great stuff, wonder if they used any frameworks like oclif or something as a
base. Looks extremely detailed, and wow, how do they always launch with such
great docs?! Baffling (in a good way)!

~~~
bckmn
Looking through the repo's dependencies ([https://github.com/stripe/stripe-
cli](https://github.com/stripe/stripe-cli)), it seems they are using the GO
CLI framework Cobra
([https://github.com/spf13/cobra](https://github.com/spf13/cobra)).

------
seph-reed
A lot of people say "mobile first," but I think that's because they're
overlooking CLI's.

They're by far the fastest way to prototype functionality, and a dream for the
QA team.

------
deforciant
that's nice! :) I have found that quite often Stripe's UI would just through
errors when trying to open some customers, failed payments or subscriptions.
Couldn't really pinpoint why it happens, tried different browsers, disabling
extensions and so on.

Hopefully CLI wil work :)

~~~
rattray
Hmm, that shouldn't happen – mind shooting me an email with an ID or two that
failed? rattrayalex at stripe.

------
daliusd
Wow, so I have implemented Stripe integration in my project recently and I was
using at least one feature mentioned in this blog. It was breeze to add
payments to my project (and I have experience with some other systems that
requires days to implement and test properly).

------
pavelevst
I’ve build something similar for our company about 4 years ago (also payment
gateway) but made it as general free tool to test webhooks via ws
[https://waithook.com](https://waithook.com)

------
18nleung
How can I get the multiple terminals view in the blog header image?

~~~
volkk
looks like just your regular iterm2 split panes?

~~~
chaos_emergent
alternately, you can use tmux which lets you detach sessions, rotate panes,
and configure them in whatever arrangement you'd like! Would highly recommend
it :)

~~~
dmlittle
Alternatively iTerm2 also comes with a native tmux integration. I personally
prefer using tmux on my own but have several friends who prefer the iTerm tmux
integration (copy-pasting text is definitely easier).

------
ibrimstone
you don't say!

------
gbanfalvi
Nice ad.

------
albatros2ko
Still waiting for my country to be supported for years now.

