Getting Started

Download the latest version of the SDK here

The SDK file should be in libs folder of project, then it can be added to build.gradle file of the project like below.

implementation files('libs/PayContactlessSDK.Embed-Stage-3.4.11.aar')

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

Check Security Mechanisms section for the other restriction.

pageSecurity Mechanisms
implementation files('libs/PayContactlessSDK.Embed-Stage-3.4.11-Debug.aar')

Debug version of the SDK must be used in integration phase by developer. For the internal and external tests, Debug version of SDK must never be used.

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.4.2"
annotationProcessor "androidx.room:room-compiler:2.4.2"
// SQLCipher
implementation "net.zetetic:android-database-sqlcipher:4.5.0"
// Gson
implementation 'com.google.code.gson:gson:2.9.0'
// Lottie
implementation "com.airbnb.android:lottie:3.4.0"
// Google Play Services
implementation 'com.google.android.gms:play-services-base:18.2.0'
// Google Play Integrity
implementation 'com.google.android.play:integrity:1.2.0'
// OkHttp3
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
// 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:

  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

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.

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

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