Toptal acquires, enhancing custom software leadership

How to Integrate a Payment Gateway in a Mobile App?

05.07.2018 Daria Mickiewicz
1 Comment
How to Integrate a Payment Gateway in a Mobile App?

Running a successful an online business means being able to process credit cards. For that reason, you have to choose a payment gateway. It allows your app to accept credit card payments from customers. Payment gateways cost money and charge per transaction. Picking the right gateway can help you save money and keep your business running smoothly.

This article examines the different types of credit card processing solutions and offers a good list of resources for reference as you search for a credit card processing provider.

What is a payment gateway?

A payment gateway is a merchant service that authorizes credit card or direct payment processing for e-businesses, online retailers, etc. It can be provided by a bank or by a specialized financial service provider.

A payment gateway facilitates a payment transaction by the transfer of information between a payment portal (like a website, mobile phone, or interactive voice response service) and the front-end processor or acquiring bank.

The following video explains the payment gateway and how it works.

How to integrate a payment gateway in Android and iOS applications

Understanding credit card processing

Customers visit the e-commerce app and choose products. Then, products are added to the cart and the cart is linked with the payment gateway.

Once the request is sent to the card processor, the payment is approved. The information is displayed from the payment gateway to the merchant account. This data will remain stored for several days unless or until it is sent to the merchant’s bank.

Understanding credit card processing

Choose seller account types

There are two main types of merchant accounts:

  1. Dedicated merchant account. With this type of service, the whole transaction cycle takes place on the merchant’s website. Once customers select items to be purchased, they are taken to the check-out page, which is SSL-secured on the server hosting the merchant’s website. Then, the merchant’s payment gateway gathers the transaction information, encrypts it again, and sends it to the card issuer for authorization. The authorization response (approval or decline) is routed back to the merchant through the gateway, and the transaction is completed.
  2. The aggregate merchant or third-party merchant account. With this type of service, the merchant outsources the payment processing part of the transaction cycle to a third party. Once customers select items to be purchased, they are taken to a check-out page hosted on the server of the third-party service provider. The merchant doesn’t have to worry about purchasing and installing SSL certificates and payment gateways, as all sensitive personal information is entered on the server of the third-party provider, who is responsible for securely handling it. PayPal, Braintree, and Stripe are a few well-known third-party service providers.

Consider types of products being sold

Depending on what you want to sell, you must consider different payment gateways. If you are dealing with physical products, you can integrate payment processors like PayPal, Visa, and MasterCard.

In a case with digital goods, note that the Google Play Store and Apple App Store mobile markets do not allow third-party e-commerce services if the application is distributed from their storage. All transactions within your application must be made using appropriate platform-specific user accounts.

Direct credit card integration

Some gateways allow purchases through debit or credit cards using the app API for processing transactions.

Note, you’ll be taking full responsibility for processing a safe and secure purchase with the digital transaction of the money while integrating the API. It means you will be responsible for any issues with online funds or fake dealing.

Payment Card Industry — Data Security Standard compliance

If you don’t want the API risk, then you can choose the Payment Card Industry Data Security Standard (PCI DSS). The PCI is a set of industrywide requirements and processes supported by every major international payment card system. It allows the management of the risk of external and internal data compromises.

The PCI has six major milestones that focus on using secure systems and protecting the cardholder data. These include removing sensitive data, protecting networks, securing payment card applications, monitoring and controlling access to systems, protecting stored cardholder data, and finalizing processes to support maintenance of PCI DSS.

If you accept Visa, MasterCard, or any charge card payments, you must comply with the PCI DSS requirements. Now let’s look at the two most popular mobile payment gateways.

Read also Case Study: Development of a pharmacy app, and its integration with the M-Pesa payment system

Payment gateway providers

Stripe integration

Stripe is one of the most popular mobile payment processors. It comprehensively supports both iOS and Android platforms for payment process and reports monthly on all payment activity. Stripe accepts over 100 currencies and supports significant libraries — iOS, Android, Ruby, PHP, and others.

Accepting a card payment using Stripe is a two-step process, with a client-side and server-side action.

From your website running in the customer’s browser, Stripe securely collects your customer’s payment information and returns a representative token. This, along with any other form data, is then submitted by the browser to your server. Using the token, your server-side code makes an API request to create a charge and complete the payment.

Tokenization ensures that no sensitive card data ever need to touch your server, so your integration can operate in a PCI compliant way. Using native mobile libraries for iOS and Android, Stripe can collect your customer’s payment information from within your mobile app and create a token for your server-side code to use.

Stripe’s rates are 2.9% + 30 cents for each successful charge. There are no monthly of setup fees, and the currency conversion fee is 2%.

Switch for a moment from reading to video and check out some great suggestions by Jared Davidson of how to integrate Stripe on your app.

Braintree integration

Braintree Direct is the recommended way to accept PayPal, credit cards, and many other payment methods in many countries. In other countries use Express Checkout and choose the Braintree SDK integration option.

You can access the Braintree iOS or Android SDK from our public GitHub repositories:

  • Braintree iOS
  • Braintree Android

Integrating with Braintree offers your customers many ways to pay. Here’s a quick list of what Braintree currently offers.

  • PayPal
  • Cards
  • Apple Pay
  • Venmo
  • Google Pay
  • UnionPay
  • Masterpass
  • Visa Checkout
  • ACH Direct Debit

Another feature in Braintree’s innovative package is bitcoin mobile app payment integration. Braintree provides developers and merchants with the ability to add bitcoin to the existing payment methods so that a user can pay in bitcoin with their Coinbase wallet and use mobile payment systems.

Many famous apps are already using Braintree’s libraries. Uber, Dropbox, Airbnb, StubHub, American Airlines — all of these companies have entrusted Braintree with their online payments.

Braintree’s rates are 2.9% of each transaction + $0.30 per transaction. Braintree supports sandbox mode as well, so you can test your integration with test values for payment method nonces, card numbers, transaction amounts, and more.

The following video explains how to integrate Braintree on your app.

Read also How to Develop a Blockchain Wallet App

Payment systems available in Europe

There are also some European payment services that may appear rather fancy and efficient. Swedish developers may choose iZetta, Klarna, or Mondido. The German mobile market is full of payment companies. Paymill and PayEleven provide similar online payment services to those offered by Stripe.

Please note, the US market is different from the European market. For this reason, you will need to think of some way to deal with international transactions. Also, do not forget about taxes and other possible commissions.

For instance, the European market uses chip-and-pin credit and debit cards to make transactions. It means you have to enter a personal identification number instead of signing for a purchase, which is still more common in the United States.

Whether you are the owner of an e-commerce business solution or have a travel business, it’s common to have a payment gateway on your mobile app or the website.

If you have any questions, don’t hesitate to contact us for more information. At VironIT, we specialize in an e-commerce mobile application development and integrating payment gateways into mobile apps.

Please, rate my article. I did my best!

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5.00 out of 5)

One response to “How to Integrate a Payment Gateway in a Mobile App?”

  1. qpnmtcsuvn says:


    Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.

Leave a Reply