Android SDK sample app
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
samples
.gitignore
CHANGELOG.md
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle
start-emulator.sh
stop-emulator.sh

README.md

Judopay Android SDK Download

The Judopay Android library lets you integrate secure in-app card payments into your Android app.

Use our UI components for a seamless user experience for card data capture. Minimise your PCI scope with a UI that can be themed or customised to match the look and feel of your app.

Requirements

Please ensure the following requirements are met when integrating the SDK:

  • Android Studio 3.1+ is installed
  • Android SDK build tools 27+ is installed
  • The minimum SDK level of your app is Android Jelly Bean (API level 16) or higher
  • Android Support Repository and Android Support Library have the latest version installed.

Getting started

1. Integration

Installation of the Judopay Android SDK is simple using Android Studio, you don't need to clone a repository, just add the dependency to your app/build.gradle file:

compile 'com.judopay:android-sdk:5.7.1'

In your project-level build.gradle file you will need to add the Judopay Maven repository:

allprojects {
    repositories {
        jcenter()
        maven {
            url "http://dl.bintray.com/judopay/maven"
        }
    }
}
2. Setup

At the point where you want to perform a payment or capture the user's card details, initialize the SDK with your account credentials from the Judopay portal:

Judo judo = new Judo.Builder()
    .setApiToken("<TOKEN>")
    .setApiSecret("<SECRET>")
    .setEnvironment(Judo.SANDBOX)
    .setJudoId("<JUDO_ID>")
    .setAmount("1.00")
    .setCurrency(Currency.GBP)
    .setConsumerReference("<YOUR_REFERENCE>")
    .build();

Note: Please ensure that you are using a unique consumer reference for each consumer of your app.

3. Make a payment

To show the payment screen, create an Intent for the PaymentActivity with the Judo instance:

Intent intent = new Intent(this, PaymentActivity.class);
intent.putExtra(Judo.JUDO_OPTIONS, judo);

startActivityForResult(intent, Judo.PAYMENT_REQUEST);
4. Check the payment result

In the Activity that calls the Judopay SDK, override the onActivityResult method to receive the payment receipt:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == Judo.PAYMENT_REQUEST) {
        switch (resultCode) {
            case Judo.RESULT_SUCCESS:
                Receipt receipt = data.getParcelableExtra(Judo.JUDO_RECEIPT);
                // success
        }
    }
}

Next steps

The Judopay Android SDK supports a range of customization options. For more information see our wiki documentation.

License

See the LICENSE file for license rights and limitations (MIT).