version 3.10.2
My2c2p Android SDK
My2c2p Android SDK library make it easy for developer to make a payment securely. The first thing you need to do is to import the library into your workspace.
You can download My2c2pSDK Android DemoApp Project here.
Download PGW SDK and unzip it, if you haven't already done so.
Important Notice
Please read this before you intergrate PGW SDK
into your project.
Android Studio: Import PGW SDK into project as module.
Step 1: Copy PGWSDK-Android-version.aar
and mandatory dependencies library into your project libs folder.
Step 2: Add following code into your project build.gradle
file.
dependencies {
//Android
def appcompat_version = "1.1.0"
def core_version = "1.2.0"
implementation "androidx.core:core:$core_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
//PGW SDK dependencies
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.squareup.okhttp3:okhttp:4.4.0" //<= 3.12.6 for 4.4 Android OS / >= 4.x.x for 5.0+ Android OS.
implementation "com.squareup.okio:okio:2.4.3"
implementation "com.squareup.picasso:picasso:2.71828"
implementation files('libs/alipaySdk-15.6.8-20191021122455-noUtdid.aar')
//2C2P Library
implementation files('libs/PGW_SDK_ANDROID_v3.8.0.aar')
}
Proguard: Please add following config into your proguard config file.
#Optional for proguard, you may use your own proguard configuration.
-dontusemixedcaseclassnames
-dontpreverify
-optimizationpasses 5
-keepparameternames
-renamesourcefileattribute SourceFile
#Mandatory for PGW SDK
#2C2P PGW Library
-dontwarn com.ccpp.my2c2psdk.**
-keep class com.ccpp.my2c2psdk.** { *; }
-keep interface com.ccpp.my2c2psdk.** { *; }
-keepclassmembers class **.R$* {
public static <fields>;
}
#okhttp3
-dontwarn okio.**
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-keepclassmembers class * extends javax.net.ssl.SSLSocketFactory {
private final javax.net.ssl.SSLSocketFactory delegate;
}
-dontwarn javax.annotation.**
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
-dontwarn org.codehaus.mojo.animal_sniffer.*
-dontwarn okhttp3.internal.platform.ConscryptPlatform
#Samsung Pay
-dontwarn com.samsung.**
-keep class com.samsung.** { *; }
#Spongy Castle
-dontwarn org.spongycastle.**
-keep class org.spongycastle.** { *; }
#AliPay
-dontwarn com.alipay.**
-dontwarn org.json.alipay.**
-keep class com.alipay.** { *; }
-keep class org.json.alipay.** { *; }
-keep class com.alipay.android.app.IAlixPay{*;}
-keep class com.alipay.android.app.IAlixPay$Stub{*;}
-keep class com.alipay.android.app.IRemoteServiceCallback{*;}
-keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
-keep class com.alipay.sdk.app.PayTask{ public *;}
-keep class com.alipay.sdk.app.AuthTask{ public *;}
-keep class com.alipay.sdk.app.H5PayCallback {
<fields>;
<methods>;
}
-keep class com.alipay.android.phone.mrpc.core.** { *; }
-keep class com.alipay.apmobilesecuritysdk.** { *; }
-keep class com.alipay.mobile.framework.service.annotation.** { *; }
-keep class com.alipay.mobilesecuritysdk.face.** { *; }
-keep class com.alipay.tscenter.biz.rpc.** { *; }
-keep class org.json.alipay.** { *; }
-keep class com.alipay.tscenter.** { *; }
-keep class com.ta.utdid2.** { *;}
-keep class com.ut.device.** { *;}
-dontwarn com.ta.utdid2.**
-dontwarn com.ut.device.**
-dontwarn com.alipay.mobilesecuritysdk.**
-dontwarn com.alipay.security.**