Managing payments in your app: incorporating Stripe

Jen Person
Google Cloud - Community
3 min readJul 22, 2020

There is a lot to do to get my crochet pattern shop up and running. So far, I have a function that adds the inventory data to Cloud Firestore. Now we need a way to get paid!

Are you new to this series? Check out the first blog for an introduction and a table of contents!

What’s the deal with payments?

Image Source

I meant to come up with a better heading for this section, but I’ve decided to embrace this one that sounds like a bad stand-up joke. But that’s where the jokes end because this is serious.

Incorporating payments into an app is unlike implementing other features in that it requires a knowledge of rules and regulations. Taking a customer’s money is serious business! (I know I said “serious” twice. But it *is* serious and I looked up synonyms for “serious” and they were all a little off the mark.)

Strong Customer Authentication

One important regulation to consider when selling products in Europe is Strong Customer Authentication, or SCA. SCA is a requirement of payments in the EU that ensures electronic payments are performed with multi-factor authentication. This is designed to increase the security of electronic payments.

We’re all familiar with multi-factor authentication for various accounts, usually involving sending a text message, sharing a code from a predefined list, or approving an action from a known good device. SCA seeks to add this level of security to electronic payments as well.

Consider regulations when implementing payment management

If you’re feeling extra zesty, you can read through the directive yourself! It’s an understatement to say that there’s a whole lot to the document. But while it is important to ensure that you understand the implications of SCA, it shouldn’t have to be your area of expertise. Your focus should be your software!

Be sure that your payment processor is up to date with payment requirements in any area you may do business.

Stripe has an array of guides about regulations, products, and business insights.

Stripe Checkout

Checkout creates a secure, Stripe-hosted payment page that lets you collect payments quickly. Even better, the Checkout payments flow will automatically add new payment methods and help you comply with regulatory requirements without any changes to your integration.

Stripe Checkout is compliant with regulatory requirements

The first step of using Stripe Checkout is to create Product and Price objects that represent your products and the price of your products. You can do this in the Stripe console or through an API. Personally, I like using the API, so that’s what I’ll be showing you. This works best for our particular use case since you can just run the function without having to go back and forth looking at a list of items and prices to add them to the console.

Uh oh…he forgot to sign the back of the card! Image Source

Ready?

Now that you know a bit about the complexity payment processing, you’re ready to build this part of the project! Here are some next steps to take:

--

--

Jen Person
Google Cloud - Community

Developer Relations Engineer for Google Cloud. Pun connoisseur.