Accepting Payments in Mobile Applications

Back to APIs

Paythru's Hosted Payment pages may also be used in mobile applications. Here's a guide to find out how.

Introduction

Paythru's Hosted Payment Pages offer a secure method for merchants to accept payment for goods and services using a variety of payment types. Within e-commerce environments, customers may be directed to the web based payment pages where they complete their payment before being redirected back to the merchant's website, all of which takes place in the customer's web browser. Paythru's Hosted Payment Pages may equally be deployed in mobile application environments. This document illustrates the methods available to mobile application developers to achieve this.

For most mobile platforms, Paythru offer two approaches:

  • Rendering the payment pages in the handset's native web browser
  • Rendering the payment pages within 'webviews' embedded in the application

Both methods offer a secure channel between the customer and Paythru to conduct the payment. The payment pages themselves may also be configured to replicate the look and feel of your mobile application providing customers with the impression that they have not been redirected elsewhere.

This document contains the recommended process flows that may be used to incorporate Paythru's Hosted Payment Pages with mobile applications as described above.

Rendering the payment pages in the web browser

Redirecting your customer to the native web browser of the mobile handset ensures that the customer is aware that the transaction is being conducted securely as the web browser will display the padlock icon and HTTPS web address that customers often look for.

The transition between the mobile application and the device's native web browser can be performed seamlessly. After the payment has been conducted, the customer may be redirected directly back to the mobile application without having to relaunch it themselves.

Rendering the payment pages within webviews

Webviews are objects of the mobile application's user interface that allow local or remote web content to be displayed. They feature on most current mobile application platforms. Loading the payment pages in a webview will mean that the transaction will be conducted without even leaving the app.

Launching Hosted Payment Pages within webviews may also be deployed in one of two methods depending on the approach used to develop the app:

  • Redirecting from an existing webview activity
  • Launching a new webview activity

For apps that use web based user interfaces hosted within webviews, the customer may simply be redirected to Hosted Payment Pages inside the existing webview. Apps that have been built using native layouts and user interface elements must launch a new webview activity to load the Hosted Payment Pages in.

Process flows

The following process flows outline the steps that should be taken by developers wishing to accept payments using Paythru's Hosted Payment Pages in their mobile applications.

Launching Hosted Payment Pages in the handset's native web browser

Launching Hosted Payment Pages in the handset's native web browser is completed using the following steps:

  • Customer clicks 'Pay now' button in native layout interface triggering request to merchant's server
  • Merchant's server makes request to Paythru's Enterprise API
  • Paythru respond including token URL
  • Merchant's server responds to app with token URL
  • App launches browser targeting token URL
  • Customer completes payment
  • Paythru issue HTTP 302 redirecting customer to 'success URL' nominated in API request. (This URL should use a custom protocol that initiates the app)
  • App launches success page activity

Redirecting to Hosted Payment Pages from an existing webview activity

Redirecting to Hosted Payment Pages from an existing webview activity is completed using the following steps:

  • Customer clicks 'Pay now' button in webview interface triggering request to merchant's server
  • Merchant's server makes request to Paythru's Enterprise API
  • Paythru respond including token URL
  • Merchant's server issues HTTP 302 redirecting customer to Hosted Payment Pages
  • Customer completes payment
  • Paythru issue HTTP 302 redirecting customer to 'success URL' nominated in API request
  • Payment success page is rendered by merchant's server

Launching Hosted Payment Pages in a new webview activity

Launching Hosted Payment Pages in a new webview activity is completed using the following steps:

  • Customer clicks 'Pay now' button in native layout interface triggering request to merchant's server
  • Merchant's server makes request to Paythru's Enterprise API
  • Paythru respond including token URL
  • Merchant's server responds to app with token URL
  • App launches new webview activity targeting token URL
  • Customer completes payment
  • Paythru issue HTTP 302 redirecting customer to 'success URL' nominated in API request. (This URL should use a custom protocol that initiates the app)
  • App launches success page activity