Skip to content

IXOPAY SDK for card tokenization on Android.

License

Notifications You must be signed in to change notification settings

ixopay/ixopay-tokenization-android

Repository files navigation

IXOPAY Android tokenization

Release JavaDoc JDK 11+ License

This SDK enables you to tokenize card data natively from your Android app to IXOPAY's PCI-certified servers.

Table of Contents

Installation

Requirements

  • JDK 8 or newer, for the demo app JDK 17 or newer
  • M2 repository compatible dependency manager
    • Gradle
    • Maven

Gradle

build.gradle

Add the jitpack.io repository:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency, replace VERSION with the GitHub release name:

dependencies {
    ...
    implementation 'com.ixopay:ixopay-tokenization-android:VERSION'
    ...
}
build.gradle.kts

Add the jitpack.io repository:

repositories {
    // ...
    maven("https://jitpack.io")
}

Add the dependency, replace VERSION with the GitHub release name:

dependencies {
    // ...
    implementation("com.ixopay:ixopay-tokenization-android:VERSION")
    // ...
}

Maven

pom.xml

Add the jitpack.io repository:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add the dependency, replace VERSION with the GitHub release name:

<dependency>
   <groupId>com.ixopay</groupId>
   <artifactId>ixopay-tokenization-android</artifactId>
   <version>VERSION</version>
</dependency>

Usage

Requirements

  • IXOPAY account
  • API User
    • username
    • password
  • Connector - consisting of
    • API key, and
    • optional: shared secret
    • public integration key

Tokenization API

Initialize TokenizationApi by at least providing a public integration key. Then call the created TokenizationApi instance's tokenizeCardData method.

class App {
    public void tokenizeCard()  {
        TokenizationApi api = com.ixopay.api.tokenization.TokenizationApi.builder()
            .integrationKey("YOUR_INTEGRATION_KEY")
            .build();

        Token result = api.tokenizeCardData(new CardData("4111 1111 1111 1111", "111", "Some cardholder", 2, 2023));
    }
}

Running the demo app

To run the demo app, set appropriate credentials in local.properties (ignored by Git) or gradle.properties (in Git) in the project root directory. Then you can start the demo app in your Android simulator.

sdk.dir=ANDROID_SDK_DIR
# default: com.ixopay.gateway_host=https://gateway.ixopay.com
# default: com.ixopay.tokenization_host=https://secure.ixopay.com
com.ixopay.integration_key=IXOPAY_INTEGRATION_KEY

Development

To run the tests, you have to inject environment variables that specify the endpoints:

./gradlew test -Dgateway=$IXOPAY_GATEWAY_HOST -Dtokenization=$IXOPAY_TOKENIZATION_HOST -Dkey=$IXOPAY_INTEGRATION_KEY

Support

If you have suggestions for new features, spotted a bug, or encountered a technical problem, create an issue here. Also, you can always contact IXOPAY's Support Team as defined in your contract.

License

This repository is available under the MIT License.

Changelog

CHANGELOG