Mobile SDKs

Hosted Checkout

6min

Overview

This guide will walk you through an easy and straightforward solution to accept payments within your application. This guide requires the use of a Web View component for secure integration with Moyasar.

Before Starting

Before you start the integration process, make sure you have completed these prerequisites:

  1. Sign up for a test account on Moyasar Dashboard
  2. Get Your API Keys to authenticate your requests.
  3. Go through this guide to understand how our payment form works

For more information, please refer to Getting Started with Moyasar.



React Native WebView

This guide will walk you through an easy and straightforward solution to accept payments within your React Native app. This guide requires the use of a Web View component for secure integration with Moyasar.

Setting Environment

If you already have a React Native project, you can skip to the next part or follow the official React Native guide; Setting up the development environment.

Add the WebView Component

New versions of React Native do not provide the WebView components out of the box, instead, you need to install something like react-native-webview to use this functionality.

Please follow the Getting Started guide of React Native WebView and make sure that your application compiles before proceeding to the next section.

Showing Payment Form

As we have mentioned in the main guide you can host the payment form and payment logic at your backend server (web application), since this will just make integration much easier and straightforward.

Hosted Payment Page

If you are following this method, please implement the payment form using this guide.

Now using the react-native-webview library before, you can show a webview and navigate to the payment page as follows:

React Native


Saving Payment ID

If you have read through the Form Configurations Moyasar Payment Form, you know that you can handle the on_completed event and read the new payment object before redirecting the user away.

If you host the page on your server, you can easily follow the Credit Card guide and see how to save the payment ID.

Updated 23 Nov 2023
Did this page help you?