Official shurjoPay Android plugin for merchants or service providers to connect with shurjoPay Payment Gateway developed and maintained by ShurjoMukhi Limited.
This plugin can be used with any Android application (e.g. Kotlin, Java).
- getToken: to get shurjoPay authorization token for future use
- makePayment: create and send payment request
- verifyPayment: to check payment status by order id
Also reduces many of the things that you had to do manually:
- Handles http requests and errors.
- JSON serialization and deserialization.
- Authentication during initiating and verifying of payments.
This document is intended for the technical personnel of merchants and service providers who wants to integrate our online payment gateway for Android application using kotlin plugin provided by shurjoMukhi Limited.
To integrate the shurjoPay Payment Gateway in your Android project do the following tasks sequentially.
android {
...
compileSdk 33
defaultConfig {
...
targetSdk 33
...
}
compileSdk 33
and targetSdk 33
required api 33 (Android Tiramisu)
To get a Git project into your build:
Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
add this to build.gradle (Module: app)
or if you are using "Android Studio Arctic Fox" or heigher add this to settings.gradle (Project Settings)
Step 2. Add the dependency
dependencies {
...
implementation "com.github.shurjopay-plugins:sp-plugin-android:2.2.1"
...
}
Step 3. Add these constraints(SP_USER, SP_PASS and SHURJOPAY_API) to configure Shurjopay instance
shurjopay = Shurjopay(
ShurjopayConfigs(
username = SP_USER,
password = SP_PASS,
baseUrl = SHURJOPAY_API
)
)
<uses-permission android:name="android.permission.INTERNET"/>
// TODO request data model setup
val data = PaymentReq(
prefix,
amount,
orderId,
currency,
customerName,
customerAddress,
customerPhone,
customerCity,
customerPostcode,
customerEmail,
)
// TODO payment request setup
shurjopay?.makePayment(this, data,
object : PaymentResultListener {
override fun onSuccess(success: ShurjopaySuccess) {
Log.d(TAG, "onSuccess: debugMessage = ${success.debugMessage}")
}
override fun onFailed(exception: ShurjopayException) {
Log.d(TAG, "onFailed: debugMessage = ${exception.debugMessage}")
}
override fun onBackButtonListener(exception: ShurjopayException): Boolean {
Log.d(TAG, "onBackButton: debugMessage = ${exception.debugMessage}")
return true
}
})
That's all! Now you are ready to use the python plugin to seamlessly integrate with shurjoPay to make your payment system easy and smooth.
- Android example application showing usage of the library.
- Sample applications and projects in many different languages and frameworks showing
- shurjopay Plugins home page on github
This code is under the MIT open source License.