Getnet DocsGetnet Docs

Installation and Configuration

This guide provides detailed instructions on how to integrate the redsys-tpv-business-lib into your Android project. The library is delivered as a local Maven repository aimed at simplifying offline and secure integration.

Prerequisites

Before integrating the library, ensure your development environment meets the following requirements:

  • Java Version: The library requires Java 21.
  • Payment Service: The Get Smart SDK Payment Service (Android APK) must be installed and running on the physical terminal.
  • Physical TPV: A physical Android TPV is required for validating transactions.

Step 1: Configure Java 21

You must configure your Android project to use Java 21 compatibility. Open your application module’s build.gradle file (typically app/build.gradle) and update the compileOptions block:

android {
    // ... existing configuration

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }
}

Step 2: Import the Repository

Getnet delivers the SDK as a ZIP file containing a local Maven repository structure. This includes:

  • AAR files for the libraries.
  • Javadoc documentation.
  • POM files for automatic dependency resolution.

1. Extract the Files

Unzip the provided delivery file to a dedicated directory on your development machine.

  • Example Path: C:\\Users\\MyUser\\RedsysRepository

2. Register the Repository

You must tell Gradle where to look for the library. Open your project’s settings.gradle file and add the local repository path to the dependencyResolutionManagement block.

Absolute Path Example:

dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("C:\\Users\\MyUser\\RedsysRepository")
        }
        google()
        mavenCentral()
    }
}

To make your project portable across different machines (e.g., for CI/CD or team collaboration), place the repository folder inside your project root (e.g., in a libs folder) and use a relative path:

url = uri("${rootDir}/libs/RedsysRepository")

Step 3: Add the Dependency

Once the repository is registered, you can add the specific library dependency to your application module.

Open your app/build.gradle file and add the following line to the dependencies block:

dependencies {
    implementation("es.redsys.adquirencia.tpva.service:redsys-tpv-business-lib:1.3.2")
}

Note: Ensure the version number (1.3.2) matches the specific version provided in your delivery package.

Dependency Resolution

The Get Smart SDK is modular. Because the provided repository includes POM files, Gradle will automatically resolve and pull in any internal Getnet dependencies required by the redsys-tpv-business-lib. You do not need to manually add other AARs from the package.

Next Steps

With the library installed and configured, you can now proceed to:

  1. Dependency Injection: Set up the library using Dependency Injection Setup.
  2. Initialization: Initialize the TPV to start communicating with the Payment Service.