This guide will walk you through a straightforward solution to accept payments within your Android application. The Moyasar Android SDK helps you accept multiple payment methods in your app including Mada, Visa, and MasterCard.
Before we can use the SDK, we have to add a couple of things within the app module build.gradle file.
We need to enable the data binding feature, so we have to add the kotlin-kapt plugin and add the following within android block:
Now, we can add the SDK dependency in the dependencies block:
Make sure you have the following permissions in your Android manifest.
The SDK currently only provides Credit Card payment integration. We can use that by first preparing our payment config object as follows:
Here is a sample Activity that shows the payment sheet:
When the user taps the button, they should see the payment sheet as follows.
The SDK is built with Kotlin and allows interoperability with Java