MCD Android SDK

Provides API to retrieve additional information about the card from 3rd party vendor’s system.

Installation

It is recommended to use Android Studio and Gradle to build the project.

Requirements

  • The device must be able to connect to the Internet.
  • Android version must be 4.4 (KitKat) or above.

Gradle Configuration

MCD SDK should be added to the project as a dependency. MCD SDK is hosted in a private Maven repository, so you need to configure build.gradle by setting the assigned URL and credentials.

Environments (library flavors):

  • test – test (staging) environment
  • prod – production environment
				
					repositories {
    maven {
        url 'https://nexus-developer.meawallet.com/content/groups/<user>-group'

        credentials {
            username '<user>-user'
            password '<password>'
        }
    }
}

dependencies {
    implementation 'com.meawallet:mcd-<user>-<environment>:<version>'
}				
			

Example:

Debug version:

				
					implementation 'com.meawallet:mcd-mea-test:1.0.0-debug'				
			

Release version:

				
					implementation 'com.meawallet:mcd-mea-test:1.0.0'				
			

App Manifest

No need to specify any permissions for SDK in AndroidManifest.xml file. MCD SDK is using the following permissions which are merged with the application manifest file:

				
					<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>				
			

Implementation guide

Before starting implementation you should have finished installation of the MCD SDK.

Overview

com.meawallet.mcd.MeaCardData is a main class for interaction with the MCD SDK. All methods are static and can be used directly without initialization of SDK.

com.meawallet.mcd.MeaCardData.Configuration is a class that provides access to the main configuration values of MCD SDK such as Version CodeVersion Name and Build Type.

Get Card Data

Two input parameters are required to retrieve card data:

  • cardId – Card ID (For the GPS customers this is Public Token Id) as presented in 3rd party vendor’s system.
  • secret – Time-based OTP value generated on the backend side.

Card data can be retrieved in two ways:

  • asynchronous (the network call is executed on a background thread and the result returned on the Main/UI thread as a callback)
				
					MeaCardData.getCardData(cardId, secret, new McdGetCardDataListener() {
    @Override
    public void onSuccess(@NonNull McdCardData mcdCardData) {
        String cardPan = mcdCardData.getPan();
        String cardCvv = mcdCardData.getCvv();

        // use retrieved data
    }

    @Override
    public void onFailure(@NonNull McdError mcdError) {
        int errorCode = mcdError.getCode();
        String errorMessage = mcdError.getMessage();

        // handle error case
    }
});				
			
  • synchronous (executed on the same thread, cannot be used from the Main/UI thread)
				
					McdCardData mcdCardData;

try {
    mcdCardData = MeaCardData.getCardData(cardId, secret);
} catch (McdException exception) {
    McdError mcdError = exception.getMcdError();
    int errorCode = mcdError.getCode();
    String errorMessage = mcdError.getMessage();

    // handle error case
}

String cardPan = mcdCardData.getPan();
String cardCvv = mcdCardData.getCvv();

// use retrieved data				
			

Error handling

McdError is a general MCD SDK error object containing all error info (error code, error name, error message and request Id). McdError can be returned with onFailure callback or gathered from McdException object.

Changelog

1.0.1

2020-04-28

REMOVEDRemoved sensitive data logging in debug builds.

1.0.0

2019-12-19

REMOVEDRemoved public access to McdErrorCode class.

0.1.0

2019-10-01

First release candidate version of MeaWallet MCD SDK for Android.

On this page