Getting Started
Depending on your build setup, add the Maven repository block to either:
build.gradle
(Groovy DSL), orsettings.gradle.kts
(Kotlin DSL)
We recommend keeping this credential in your local.properties file
//dependencyResolutionManagement block
dependencyResolutionManagement {
repositories {
maven {
name = "ProphiusNexus"
url = uri("https://nexus.prophius-api.com/repository/maven-releases/")
// Load Nexus credentials from local.properties
val localPropsFile = rootDir.resolve("local.properties")
if (localPropsFile.exists()) {
val props = Properties().apply {
load(localPropsFile.inputStream())
}
credentials {
username = props.getProperty("YOUR USERNAME") ?: ""
password = props.getProperty("YOUR PASSWORD") ?: ""
}
} else {
println("⚠️ Warning: local.properties not found. Credentials are missing.")
}
}
// Optional defaults
google()
mavenCentral()
}
}
Add the SDK dependency in your module level build.gradle file of the project like below.
implementation 'com.prophius:paycontactlesssdk.embed.stage:3.4.14'
This version of the SDK must be used in integration phase by developer. For the internal and external tests, the version of SDK must never be used.
Required Dependencies
SDK needs some third party libraries and the integrator app must have these dependencies. The libraries which is shared below should be added to the build.gradle file.
// Room
implementation "androidx.room:room-runtime:2.7.0"
annotationProcessor "androidx.room:room-compiler:2.7.0"
// SQLCipher
implementation "net.zetetic:android-database-sqlcipher:4.5.0"
// Gson
implementation "com.google.code.gson:gson:2.10.1"
// Lottie
implementation "com.airbnb.android:lottie:3.4.0"
// Google Play Services
implementation "com.google.android.gms:play-services-base:18.6.0"
// Google Play Integrity
implementation "com.google.android.play:integrity:1.4.0"
// OkHttp3
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "com.squareup.okhttp3:logging-interceptor:4.10.0"
// Material
implementation "com.google.android.material:material:1.9.0"
In order to support schemas' branding animations, jetifier tools must be enabled on your project. The following configuration must be added on your gradle.properties
file.
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
Using the PayContactless Embed SDK Library
Before accessing the functions within the PayContactless Embed SDK library, there are a few steps to follow:
Initialization: Begin by calling the
start
method.Accessing the SDK: Utilize the
getInstance
method. This will allow you to access various methods underPayContactlessEmbed
.Required Parameters:
Context: Application context
Organization Id: Predefined organization identenfier
Google Clould Project Number: Project Number of your project on Google Cloud
PayContactless Embed SDK uses Play Integrity API for Automatic integrity protection. You need to enable Integrity API on your project and share required credentioans to the PayContactless team. Please check Play Integrity Configuration section.
Remember to pass the these parameters as arguments when invoking the start
method.
By adhering to these steps, you'll ensure the proper and utilization of the PayContactless Embed SDK library functions.
A sample method is highlighted below;
PayContactlessEmbed.getInstance().start(context, organizationId, googleCloudProjectNumber)
Where context (app context), organization (Integer), and the googleCloudProjectId (String).
PaycontaclessEmbed needs the acvitiy result to parse the Payment activity reponse. The onAcitivtyResult
method of the SDK must be called in current activity's onActivityResult
method.
PayContactlessEmbed.getInstance().onActivityResult(requestCode,resultCode,data)
A sample usage is highlighted below;
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
PayContactlessEmbed.getInstance().onActivityResult(requestCode,resultCode,data)
}
Last updated