Android
D1 SDK is released in two variants: debug and release.
Since version 4.4.0, the package also includes samsungpay_2.17.00.jar for Samsung Pay integration.
Since version 4.5.0, the package also includes play-services-tapandpay-18.7.0.aar for Google Pay integration
<d1-release-package>
├── binaries
│ ├── samsungpay_2.17.00.jar
│ ├── play-services-tapandpay-18.7.0.aar
│ ├── d1-debug.aar
│ └── d1-release.aar
└── javadoc
│ └── ...This guide is tested with the following environments:
Android Studio Narwhal
Android Gradle Plugin 8.7.0
To integrate D1 SDK into your Android issuer application:
Copy the AAR and JAR files
Copy all files from <d1-release-package>/binaries into the libs folder in your project. Create libs if needed.
Since version 4.4.0, copy Samsung Pay SDK JAR file into the libs folder as well.
Since version 4.5.0, copy Google Tap And Pay SDK AAR file into the libs folder as well.
Your project should look like this:
├── app
│ └── libs
│ ├── samsungpay_2.17.00.jar // since SDK 4.4.0
│ ├── play-services-tapandpay-18.7.0.aar // since SDK 4.5.0
│ ├── d1-debug.aar
│ └── d1-release.aar
│ └── ...
├── gradle
│ └── ...
├── build.gradle
├── gradle.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradleUpdate build.gradle
Add the following to the app-level build.gradle to include D1 SDK and its dependencies:
repositories {
flatDir { dir "libs" }
}
android {
// Starting from SDK 4.4.0
buildTypes {
debug {
manifestPlaceholders = [DEBUG_MODE: 'Y', SPAY_API_LEVEL: 2.17]
}
release {
manifestPlaceholders = [DEBUG_MODE: 'N' , SPAY_API_LEVEL: 2.17]
}
}
}
dependencies {
releaseImplementation(name: 'd1-release', ext: 'aar')
debugImplementation(name: 'd1-debug', ext: 'aar')
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.appcompat:appcompat:[1.0.0,1.3.1]"
implementation "net.java.dev.jna:jna:5.17.0@aar"
// Starting from SDK 4.4.0, Google Play Services dependencies should be at least the following versions:
implementation "com.google.android.gms:play-services-base:18.5.0"
implementation "com.google.android.gms:play-services-basement:18.9.0"
// Starting from SDK 4.4.0
implementation files('libs/samsungpay_2.17.00.jar')
//Starting from SDK 4.5.0
implementation files("libs/play-services-tapandpay-18.7.0.aar")
// For Payment Passkey, starting from SDK 4.5.0
implementation 'androidx.browser:browser:1.8.0'
// For D1Pay
implementation "com.google.firebase:firebase-messaging:23.0.2"
// For D1Authn (3DS)
// Credentials API. This API requires a mimimum compileSdkVersion of 34.
implementation "androidx.credentials:credentials:1.2.2"
// needed for credentials support from play services, for devices running Android 13 and below.
implementation "androidx.credentials:credentials-play-services-auth:1.2.2"
implementation "com.google.android.gms:play-services-fido:20.0.1"
implementation "androidx.biometric:biometric:1.1.0"
// okhttp is no longer required on SDK v4.2.0 and later
// implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
}Attaching Javadocs in Android Studio
Add SDK as gradle dependency to application
releaseImplementation(name: 'd1-release', ext: 'aar').Select
Projectview for your project structure.Expand
External Libraries.Right click on SDK and choose
Library PropertiesClick on middle '+' button to specify documentation URL: https://thalesgroup.github.io/d1sdk-docs/d1-sdk/latest/android/index.html
Quick documentation lookup in Android Studio:
Control + Q (Windows/Linux)
Control + J (Mac)
Última actualización
¿Te fue útil?