Android SDK

Liquid Pay SDK (Consumer) is a framework that can be used by Merchants to integrate to their online mobile client applications. Merchants that are currently part of the Liquid Pay portfolio and who desire to let their consumers buy products online from their store and pay through Liquid Pay, can use this SDK for the purposes of integration.

 

Files

LiquidPaySDKv1(Android).zip

LiquidPaySDKSample

Step 1

Attach LiquidPay SDK (Android) and put .aar file provided by Liquid Pay inside your app library folder. For instance C:\ClientApp\app\libs.

Step 2

Replace your project root build.gradle (C:\ClientApp\build.gradle) as shown in Figure below.

Before :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle: $client_gradle_tools_version'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}

After :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle: $client_gradle_tools_version''
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        flatDir{
	dirs ‘libs’
        }
    }
}

Step 3

To import the aar file in your project, compile the aar file into your build.gradle in app module root (C:\ClientApp\app\build.gradle) and add external(3rd party) dependencies as required for liquid pay sdk. As shown in Figure below

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

project.ext {
    playServicesVersion = '9.4.0'
    supportLibVersion = '25.3.0'
    retrofitVersion = '2.1.0'
    okHttpVersion = '3.3.1'
    daggerVersion = '2.2'
    stethoVersion = '1.3.1'
    timberVersion = '4.5.1'
    autoParcelVersion = '0.1'

}

Dependencies{
       //client libraries
       ...
       ...

       //liquid pay sdk
compile(name: 'LiquidPaySDKv1', ext: 'aar') 

//3rd party libraries to ignore error
//retrofit
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"
compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion"

// okHttp
compile "com.squareup.okhttp3:okhttp:$okHttpVersion"
compile "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"

//stetho
compile "com.facebook.stetho:stetho:$stethoVersion"
compile "com.facebook.stetho:stetho-okhttp3:$stethoVersion"

//timber logger
compile "com.jakewharton.timber:timber:$timberVersion"

//dagger
apt "com.google.dagger:dagger-compiler:$daggerVersion"
compile "com.google.dagger:dagger:$daggerVersion"
    provided 'javax.annotation:jsr250-api:1.0'

//auto parcel gson
compile "me.tatarka:auto-parcel-gson:$autoParcelVersion"
    apt "me.tatarka:auto-parcel-gson-processor:$autoParcelVersion"

//date time formatting lib
compile 'net.danlew:android.joda:2.9.9'

//loopj client
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.dagger:dagger:2.2'
provided 'javax.annotation:jsr250-api:1.0'

apt 'me.tatarka:auto-parcel-gson-processor:0.1'
compile 'me.tatarka:auto-parcel-gson:0.1'
}

Initialization

Initialization to use LiquidPay SDK.

LiquidPay.getInstance().init(context, API_KEY, API_SECRET, GCM_ID);
Context -> Client application context
API_KEY -> Client Liquid Pay unique API KEY from here
API_SECRET-> Client Liquid Pay unique API_SECRET, which will be assigned after successful register on the developer portal.
GCM_ID -> Client generated token from google cloud messaging for notification