How to handle payments in React Native

Managing payments in React Native has always been more difficult than it should have been. For some time, your options were limited to either developing the payment functionality yourself or instead use a third-party package.

Both options came with caveats that were hard to ignore. The biggest of them was the nagging issue of security. Payment systems should look and feel secure (and of course be secure). If they are not, users will think twice before paying for a product or service.

Given the fast-paced nature of development, especially if you work in a startup, where decisions have to be made fast, your options are limited.

So how to make the right decision?

First, there is always the possibility to develop the functionality yourself. Realistically it’s not an option since it would require extensive knowledge in native development and of course a lot of time. Although there are some benefits (control being one of them), the cons considerably outweigh the pros.

So why not just use an already developed and tested package? Here lies the next issue. There are so many packages (it’s JavaScript after all 😉) to choose from that it becomes hard to distinguish the good from the bad.

So, to make it simpler, you can think of 7 questions while doing your search:

  1. Do I need Apple Pay and Google Pay?
  2. How large is the community that supports the package?
  3. Does the package connect with a well-known payment processing solution (e.g., Stripe, Braintree, PayPal)?
  4. Is the payment processing solution available in countries I want to sell goods and services in?
  5. Are all well-known credits cards available?
  6. Does the package comply with Strong Customer Authentication (SCA) regulation in Europe?
  7. Does the package offer a prebuilt payment UI?

You might think to yourself: how am I going to check all this?! 🤯

Well, the answer is easier than you think. A while ago, the decision would have been mind-bogglingly complex; trying to go through all the third-party packages that are out there and figuring out answers to all the above questions was a nightmare.

Luckily, Stripe has finally decided to release their official package! 🥳

Keep in mind that the package was first released in May 2021, meaning that still not all functionalities are supported. The most noticeable absence is Android Pay. But it’s in the final step of testing, so it will be added soon. Everything else that you might expect has been added and works great.

Let’s see how the solution from Stripe stacks up to our questions:

  1. It offers Apple Pay, Android Pay is in the final steps of development.
  2. Currently average. The package has 587 stars on GitHub but still growing.
  3. Yes, it is being developed and maintained by Stripe.
  4. Available in 44 countries. This includes all of the EU, Japan, UK, and USA.
  5. VISA and Mastercard are supported in every country. Others are available as well.
  6. Plus, there is also the option to design the UI yourself.

We know Stripe might not work for everybody. Especially if you already use other payment processing solutions on other platforms. However, at the moment, they are the only “big” company that offers an official package.

If you want to learn more about this topic, have a look at some other interesting articles 👇

[1] Official Stripe documentation

[2] stripe-react-native GitHub repository

[3] Add stripe to react-native app tutorial

[4] Should you use the official Stripe package in your React Native app

Leave a Reply

Your email address will not be published. Required fields are marked *