External Native Modules (Android)
The WHITELABEL Android SDK stays small on purpose: every third-party native SDK ships as a separate, optional module. You add only the modules your integration needs, and the WHITELABEL SDK picks them up automatically when a checkout uses the matching provider. Your payment and enrollment code does not change.
Modules are activated by your WHITELABEL account configuration, not by code: the SDK uses a module only when WHITELABEL indicates it is needed for the current transaction. If a provider is not configured for your account, its module is simply never used.
How it works
- You add the module to your app as a Gradle dependency, next to the WHITELABEL SDK.
- When the app starts, the module registers itself with the WHITELABEL SDK. There is no code to write.
- During checkout, the WHITELABEL SDK asks the backend which providers apply to the transaction and uses the matching module: for example, it collects a device fingerprint and attaches it to the payment, or runs the 3D Secure challenge natively instead of in a WebView.
Available modules
| Module | What it adds | Minimum Android |
|---|---|---|
| ClearSale antifraud | Collects the ClearSale device fingerprint and attaches it to the payment | 6.0 (API 23) |
| Koin antifraud | Collects the Koin device fingerprint and attaches it to the payment | 6.0 (API 23) |
| Netcetera 3DS | Runs 3D Secure challenges natively in your app, for payments and enrollment | 6.0 (API 23) |
Maven coordinates and compatibility:
| Module | Dependency | Current version | Requires android-sdk |
|---|---|---|---|
| ClearSale antifraud | com.yuno.payments:yuno-sdk-antifraud-clearsale | 1.0.0 | 2.25.0 or higher |
| Koin antifraud | com.yuno.payments:yuno-sdk-antifraud-koin | 1.0.0 | 2.25.0 or higher |
| Netcetera 3DS | com.yuno.payments:yuno-sdk-3ds-netcetera | 1.0.1 | 2.16.0 or higher |
All modules are published to the same repository as the WHITELABEL SDK (https://yunopayments.jfrog.io/artifactory/snapshots-libs-release). A module does not pin a specific WHITELABEL SDK version: you stay in control of the android-sdk version, as long as it is at or above the minimum in the table. Netcetera has extra setup (a second Maven repository and a sandbox certificate), covered in Netcetera 3DS (Android).
Installation
Add the modules you need to your app module’s build file, next to the WHITELABEL SDK dependency. Each module already brings its vendor SDK and its own dependencies, so nothing else is required.
In build.gradle:
dependencies {
implementation "com.yuno.payments:android-sdk:{last_version}"
// Add only the modules your account uses
implementation "com.yuno.payments:yuno-sdk-antifraud-clearsale:1.0.0"
implementation "com.yuno.payments:yuno-sdk-antifraud-koin:1.0.0"
implementation "com.yuno.payments:yuno-sdk-3ds-netcetera:1.0.1"
}In build.gradle.kts:
dependencies {
implementation("com.yuno.payments:android-sdk:{last_version}")
// Add only the modules your account uses
implementation("com.yuno.payments:yuno-sdk-antifraud-clearsale:1.0.0")
implementation("com.yuno.payments:yuno-sdk-antifraud-koin:1.0.0")
implementation("com.yuno.payments:yuno-sdk-3ds-netcetera:1.0.1")
}The Netcetera module also needs Netcetera’s Maven repository declared in your project, because its 3DS SDK is not hosted on Maven Central. The exact lines are in Netcetera 3DS (Android). The antifraud modules need no extra repository.
Activating a module
Every module registers itself with the WHITELABEL SDK when your app process starts, through Jetpack App Startup. No code is required: keep initializing the WHITELABEL SDK exactly as you do today.
import com.yuno.payments.Yuno
Yuno.initialize(
application = this,
apiKey = "YOUR_API_KEY",
)Once a module is registered the WHITELABEL SDK uses it automatically. You do not need to change any payment, enrollment or 3DS code.
To confirm a module loaded, filter Logcat by its tag right after the app starts. Each module prints one line when it registers:
adb logcat -s KoinAntifraud
adb logcat -s ClearSaleAntifraudIf your app disables App Startup #
Some apps remove the App Startup content provider from their manifest (androidx.startup.InitializationProvider with tools:node="remove") to control startup work themselves. In that case the modules cannot register on their own. Run their initializers yourself, once, before Yuno.initialize(...), using App Startup’s manual API:
import androidx.startup.AppInitializer
import com.yuno.antifraud.clearsale.ClearSaleAntifraudInitializer
import com.yuno.antifraud.koin.KoinAntifraudInitializer
import com.yuno.threedsecure.netcetera.Netcetera3DSInitializer
val initializer = AppInitializer.getInstance(applicationContext)
initializer.initializeComponent(ClearSaleAntifraudInitializer::class.java)
initializer.initializeComponent(KoinAntifraudInitializer::class.java)
initializer.initializeComponent(Netcetera3DSInitializer::class.java)Initialize only the modules you installed; the example lists all three for reference.
What each module needs from your app
ClearSale antifraud
- Sends ClearSale’s own session id to WHITELABEL as the payment’s
customer.device_fingerprint. Nothing changes in the data you send. - Collection runs when the shopper confirms the payment. It is bounded by the
timeoutconfigured for the ClearSale provider in your WHITELABEL account (5 seconds by default). Keep that timeout above 1 second, otherwise collection times out and the payment continues without a fingerprint. - Declares
INTERNET,ACCESS_NETWORK_STATEandACCESS_WIFI_STATE; they are merged into your manifest automatically. - Never requests or uses location. Do not add
play-services-locationversion 21 or higher next to this module: those versions are incompatible with the bundled ClearSale SDK.
Because the location library is absent, the ClearSale SDK prints a NoClassDefFoundError: com.google.android.gms.location.LocationServices stack trace on every collection. It is caught inside the ClearSale SDK, which then skips its location collector. The trace is expected and harmless.
Migrating from the legacy com.yuno.fraud-prevention:clearsale dependency #
If your app integrated ClearSale directly through the former com.yuno.fraud-prevention:clearsale dependency:
- Remove that dependency from your app’s build file and add
yuno-sdk-antifraud-clearsaleinstead. - Remove the
onCreateYunoClearSale,onResumeYunoClearSaleandonStopYunoClearSalecalls from your Activity lifecycle methods. - Stop passing the ClearSale session id as
merchantSessionId. The WHITELABEL SDK now collects and sends it for you.
Koin antifraud
- Sends the Koin device fingerprint to WHITELABEL as the payment’s
customer.device_fingerprint. Nothing changes in the data you send. - Declares
INTERNET; it is merged into your manifest automatically. - Never requests or uses location. The Koin SDK is initialized with its geolocation feature disabled, so the module does not read
ACCESS_FINE_LOCATIONorACCESS_COARSE_LOCATIONeven when your app holds them.
Netcetera 3DS
- Runs the 3D Secure challenge inside your app, for payments and card enrollment, instead of the WebView-based challenge. If your app customizes the WHITELABEL SDK styles, they propagate to the challenge screen.
- Needs Netcetera’s Maven repository in your project and, for sandbox testing only, a certificate provided by your WHITELABEL TAM. Both steps are in Netcetera 3DS (Android).
Troubleshooting
The module is installed but the fingerprint or native challenge never shows up #
Check, in this order:
- The provider is enabled for your WHITELABEL account. Modules only run when the backend asks for that provider on the transaction; ask your WHITELABEL TAM if you are not sure.
- The module registered at startup: filter Logcat by
KoinAntifraudorClearSaleAntifraudand look for theregisteredline. - Your app is not removing the App Startup provider from the manifest. If it is, run the module initializers manually as described in Activating a module.
Crash at runtime with NoSuchMethodError or NoSuchFieldError mentioning com.yuno #
Your android-sdk is older than the version the module requires. Bump it to the minimum listed in Available modules, or higher.
Gradle: could not find com.netcetera.threeds… #
Netcetera’s SDK is not on Maven Central. Declare Netcetera’s Maven repository as shown in Netcetera 3DS (Android).
Logcat: NoClassDefFoundError com.google.android.gms.location.LocationServices (ClearSale) #
Expected. The ClearSale SDK looks for the location library, does not find it, and skips its location collector. The fingerprint is still collected. Do not add play-services-location 21 or higher to work around it: it breaks the bundled ClearSale SDK.
Payments go through but without a ClearSale fingerprint #
The provider timeout configured in your WHITELABEL account is too low for ClearSale’s capture (which waits 500 ms before generating the session id). Keep it at 1 second or more; the default is 5 seconds.
Manifest merger conflict on androidx.startup.InitializationProvider #
Another library in your app also uses App Startup with a conflicting declaration. Merge both with tools:node="merge" on the provider, or run the module initializers manually as described in Activating a module.
R8 / ProGuard rules for every module and its vendor SDK ship as consumer rules. No manual configuration is required when minifying your app.