Getting Started

To download the PayContactless embedded SDK, you will be provided with secure credentials (username and password).

Follow the steps below to configure your project and fetch the SDK dependency.

Depending on your build setup, add the Maven repository block to either:

  • build.gradle (Groovy DSL), or

  • settings.gradle.kts (Kotlin DSL)

//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'

SDK does not allow to run the app on debug. The application must be release build.

Check Security Mechanisms section for the other restriction.

Security Mechanisms

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"

Using the PayContactless Embed SDK Library

Before accessing the functions within the PayContactless Embed SDK library, there are a few steps to follow:

  1. Initialization: Begin by calling the start method.

  2. Accessing the SDK: Utilize the getInstance method. This will allow you to access various methods under PayContactlessEmbed.

  3. Required Parameters:

    • Context: Application context

    • Organization Id: Predefined organization identenfier

    • Google Clould Project Number: Project Number of your project on Google Cloud

Play Integrity Configuration

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).

Important Recommendation for Using PayContactlessEmbed SDK

For optimal functionality and seamless integration, it is strongly advised to invoke the start method of PayContactlessEmbed within the onCreate method of your application.

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