To use this library you will need to target Android devices that:
- Have Android 11.0+ (API 30+)
- Have NFC capability
- Have internet access
- Have Google Mobile Services installed and pass CTS
Tyro Tap To Pay SDK is distributed via Github Packages, so you will need a Github account.
Follow these steps to create a Personal Access Token (PAT).
A 'classic' token with (at least) public_repo
scope is sufficient.
Once you have created your PAT, you will need to reference it from your Android project.
You can do this using environment variables, as in the example below.
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://maven.pkg.github.com/tyro/tyro-tap-to-pay-sdk-android")
credentials {
username = System.getenv("GITHUB_PACKAGES_USER")
password = System.getenv("GITHUB_PACKAGES_TOKEN")
}
}
}
}
dependencyResolutionManagement {
repositories {
maven {
url 'https://maven.pkg.github.com/tyro/tyro-tap-to-pay-sdk-android'
credentials {
username System.getenv("GITHUB_PACKAGES_USER")
password System.getenv("GITHUB_PACKAGES_TOKEN")
}
}
}
}
val tyroSdkVersion by extra("<VERSION>")
dependencies {
// ...
debugImplementation("com.tyro:tyro-tap-to-pay-sdk-debug:$tyroSdkVersion")
releaseImplementation("com.tyro:tyro-tap-to-pay-sdk-release:$tyroSdkVersion")
}
ext { set('tyroSdkVersion', '<VERSION>') }
dependencies {
// ...
debugImplementation "com.tyro:tyro-tap-to-pay-sdk-debug:${tyroSdkVersion}"
releaseImplementation "com.tyro:tyro-tap-to-pay-sdk-release:${tyroSdkVersion}"
}
Tyro publishes two dependencies:
tyro-tap-to-pay-sdk-debug
tyro-tap-to-pay-sdk-release
The release
dependency includes some additional security checks.
Most notable of these is that it requires on-device developer mode to be disabled.
The debug
build published by Tyro does not have this requirement, making testing easier.
It is, however, obfuscated and non-debuggable.
You will need to configure your debug
build type to accept tyroDebug
as a fallback.
android {
// ...
buildTypes {
// ...
debug {
// ...
matchingFallbacks += listOf("tyroDebug")
}
}
}
android {
// ...
buildTypes {
// ...
debug {
// ...
matchingFallbacks.add("tyroDebug")
}
}
}
Tyro Tap to Pay SDK does not currently support R8 full mode.
You may need to include the following line in gradle.properties
.
android.enableR8.fullMode=false
The demo app has three build flavors:
- stub
- dev
- prd
The app should run in stub
flavor out of the box which emulates success.
If you want get to test the sample app in the development environment, you will need to:
- Obtain the keystore
sampleappkeystore.jks
file and password from Tyro and place the keystore in theSampleApp/app
folder. - Update the
signingConfigs
,storeFile
,keyPassword
,storePassword
part ofapp/build.gradle.kts
with the keystore and password provided to you.
If you want to run your own App against development or production environments, you will need to:
- Change the
applicationId
inbuild.gradle
to your own - Include your own keystore, and update the
signingConfigs
part ofbuild.gradle
with your keystore details - Export a public certificate from your keystore and provide it to Tyro along with your
applicationId
- Run the following to generate your public cert:
keytool -export -alias key0 -keystore yourkeystore.jks -rfc -file publiccert.pem
- Make sure the alias is the same as the one you used to generate the keystore
- Run the following to generate your public cert:
- Implement authentication with Tyro on your own server
See our documentation preview for more detail on these requirements.
Please note: digital receipt functionality does not work on the sandbox environment
Reach out to the Connect Support Team
at [email protected]