Installation

Development setup

DescriptionAPI version
Minimum API LevelMinAPI
Target API LevelTargetAPI
Java VersionJava
SDK VersionVersion
LicenseLicence

Configure your project to use Java Development Kit (JDK) 11.

In your app’s build.gradle file, set the minSdkVersion to 21 and targetSdkVersion to 31.

Add Maven Central and the build-info extractor inside the buildscript {} block:

build.gradle (root) – buildscript section
1buildscript {
2 repositories {
3 mavenCentral()
4 }
5 dependencies {
6 classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
7 }
8}

Add the remote repository (maven url) to your Gradle dependencies under the build.gradle -> allprojects{} section.

1allprojects {
2 repositories {
3 mavenCentral()
4 // Include the Payments SDK (related dependencies)
5 maven { url 'https://yocotechnologies.jfrog.io/artifactory/public/' }
6 }
7}

At the end of the file, apply the artifactory plugin.

1apply plugin: "com.jfrog.artifactory"

Integrators (third parties)

Add the dependency to a module that will be using the SDK:

1implementation 'com.yoco:payment-ui:<version>'

Additional setup

The Yoco SDK relies on Android’s Data Binding library; any module that uses the YocoSDK must have Data Binding enabled.

For more information, see the databinding guide.

1 android {
2 ...
3 dataBinding {
4 enabled = true
5 }
6}

ProGuard setup

If your project uses ProGuard for minification and obfuscation, then add the rules below to your ProGuard file.

ProGuard rules
# Material Library (Used by PaymentsSDK)
-keep class com.google.android.material.** { *; }
-keep @kotlinx.serialization.Serializable class *
# Koin workmanager
-keep class com.birbit.android.jobqueue.** { *; }
-dontwarn com.birbit.android.jobqueue.scheduling.Gcm*
-dontwarn com.google.android.material.**
-dontnote com.google.android.material.**
-keep class com.yoco.ono.common.miura.** { *; }
-keep class com.yoco.ono.android.miura.** { *; }
-keep class com.yoco.ono.common.dspread.** { *; }
-keep class com.yoco.ono.android.dspread.** { *; }
-keep class com.yoco.ono.common.datecs.** { *; }
-keep class com.yoco.ono.android.datecs.** { *; }
-keep class com.yoco.ono.common.bluetooth.** { *; }
-keep class com.yoco.ono.android.bluetooth.** { *; }
-keep class com.yoco.ono.common.cloud.** { *; }
-keep class com.yoco.ono.android.cloud.** { *; }
-keep class com.yoco.ono.common.modules.sdk.models.** { *; }
-keep class com.yoco.ono.android.modules.** { *; }

Sync the project to download the dependency.