DEV Community

andyreadpnw
andyreadpnw

Posted on

Stripe: Easy Payment Processing for Developers

Stripe is a full payment processing platform targeted for developers. It allows you to make subscriptions, charge credit cards, use Apple Pay, and much more as a third-party payment gateway. Stripe shoulders the PCI compliance, which is an expensive and stringent security certification for anything that requires the server to hold credit card data. So by using Stripe, we can bypass having to do all of that ourselves and can integrate it in our full-stack web apps without doing the hard stuff ourselves.

Stripe has great and easy to use documentation on how to integrate payments with your app. The main components you will need to make it work are a token, a name, and a secret key. Here is a sample promise:

Alt Text

The token and the secret key will be static with your account and remember to keep the secret key hidden with git.ignore. The only remaining thing to implement is the form for name and CC details. This is my super basic implementation:

Alt Text

Once you submit the form the fetch will send that data to Stripe and send back a response. As you can see here we got a successful token and processed payment!

Alt Text

I look forward to building in more complex functionality, but Stripe is super easy to set up and begin playing with. I recommend anyone who wants to take the hassle out of payment processing to use Stripe!

Top comments (0)