Native SDK - Android Integration Guide
About 596 wordsAbout 2 min
2026-04-03
Prerequisites
Before starting Android integration, make sure you have completed the preparation process and server-side integration in the Native SDK Overview.
Environment Requirements
| Item | Requirement |
|---|---|
| Android Gradle Plugin (AGP) | 8.13.2 |
| Java | 17 |
| Android SDK | compileSdk 36, targetSdk 36, minSdk 24 |
| OkHttp | 4.12.0 |
| Gson | 2.11.0 |
| Retrofit | 2.11.0 |
Import Instructions
Manual Integration
Download the Android SDK AAR file.
Please contact PingPong technical support to obtain the download URL.
Import dependency into Android Studio project.
Copy the aar file to the module's libs directory, add dependency in module's gradle file:
build.gradle
dependencies {
implementation files('libs/payment-android-sdk-1.0.0.aar')
}Core Concepts and Interaction Sequence
SDK Configuration and Key Objects
Key Objects Description
| Class Name | Description |
|---|---|
| PPPayment | SDK main entry class |
| PaymentConfig | SDK configuration class |
| PaymentResult | Payment result callback (Sealed Class) |
| Environment | Environment enumeration (SANDBOX/ONLINE/ONLINE_US) |
Environment Configuration
Environment Enumeration:
Environment.kt
enum class Environment {
SANDBOX, // Sandbox environment
ONLINE, // Production environment - Europe
ONLINE_US // Production environment - US
}| Enumeration Value | Description | API Endpoint |
|---|---|---|
| SANDBOX | Sandbox Environment | https://sandbox-acquirer-payment.pingpongx.com |
| ONLINE | Production Environment - Europe | https://acquirer-payment.pingpongx.com |
| ONLINE_US | Production Environment - US | https://acquirer-payment-checkout-us.pingpongx.com |
Cross-Platform Mapping:
| Android | iOS Equivalent | Description |
|---|---|---|
SANDBOX | PPCDEnvironmentTypeSandBox | Sandbox environment |
ONLINE | PPCDEnvironmentTypeRelease | Production Europe |
ONLINE_US | PPCDEnvironmentTypeReleaseUS | Production US |
Configuration Example:
PaymentConfig Initialization
val config = PaymentConfig(
environment = Environment.SANDBOX, // Sandbox
// environment = Environment.ONLINE, // Production Europe
// environment = Environment.ONLINE_US // Production US
logEnabled = true,
cardBinLength = true
)Key Integration Steps
Step 1: Initialize SDK
PaymentConfig.kt
val config = PaymentConfig(
environment = Environment.SANDBOX, // Control environment switch
logEnabled = true, // Enable/disable SDK logging
cardBinLength = true // Set card BIN digit length
)Step 2: Launch Checkout
PaymentActivity.kt
// 1. Create payment instance
val payment = PPPayment(activity, PaymentResultCallback { result ->
when (result) {
is PaymentResult.Completed -> {
// Payment information submitted successfully. This does NOT indicate payment success.
// Verify final status via server-side confirmation.
}
is PaymentResult.Canceled -> {
// User canceled
}
is PaymentResult.Failed -> {
// Payment flow failed or was interrupted.
// Always verify final status via server-side confirmation.
}
}
})
// 2. Launch the checkout
payment.presentPayment(
token = "your_token",
config = config
)