Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

Step 1 - Update the Gradle Build Properties to Integrate Cardinal Mobile SDK

In Android Studio, open the app directory (which can also be labeled Module: app) and then open the build.gradle file. Double-check to make sure that you edit the Gradle file that is located in the app directory. Add the following contents to the Gradle file.

Code Block
themeEmacs
repositories {
    ...
	maven {
		url  "https://cardinalcommerce.bintray.com/android"
		credentials {
			username ''//Bintray username
            password ''//Bintray user API Key
		}
	}
}
dependencies {
    ...
	//Cardinal Mobile SDK
	implementation 'org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.3-2'
}

If your project uses Progurad, add the following lines into proguard-rules.pro file

Code Block
themeDJango
titleproguard-rules.pro
linenumberstrue
collapsetrue
-keep class com.cardinalcommerce.dependencies.internal.bouncycastle.**
-keep class com.cardinalcommerce.dependencies.internal.nimbusds.**


Info

For Bintray username and API Key please reach out to your client manager.

Step 2 - Configure Cardinal Mobile SDK

Upon successfully completing Integration in Step 1, get the instance of the cardinal object by Cardinal.getInstance(). SDK offers multiple configuration options for you (if not specified, everything is set to default). For more details: CardinalConfigurationOptions. Use the code snippet below for completing the cardinal.configure()

Code Block
languagejava
themeEmacs
titleJava
private Cardinal cardinal = Cardinal.getInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {

CardinalConfigurationParameters cardinalConfigurationParameters = new CardinalConfigurationParameters();
        cardinalConfigurationParameters.setEnvironment(CardinalEnvironment.STAGING);
        cardinalConfigurationParameters.setRequestTimeout(8000);
		cardinalConfigurationParameters.setChallengeTimeout(5);
        
		JSONArray rType = new JSONArray();
        rType.put(CardinalRenderType.OTP);
        rType.put(CardinalRenderType.SINGLE_SELECT);
        rType.put(CardinalRenderType.MULTI_SELECT);
        rType.put(CardinalRenderType.OOB);
        rType.put(CardinalRenderType.HTML);
        cardinalConfigurationParameters.setRenderType(rType);

        cardinalConfigurationParameters.setUiType(CardinalUiType.BOTH);

        UiCustomization yourUICustomizationObject = new UiCustomization();
        cardinalConfigurationParameters.setUICustomization(yourUICustomizationObject);

        cardinal.configure(this,cardinalConfigurationParameters);

}


Code Block
languagejava
themeEmacs
titleKotlin
collapsetrue
private val cardinal: Cardinal = Cardinal.getInstance()

override fun onCreate(savedInstanceState: Bundle?) {
		
		val cardinalConfigurationParameters = CardinalConfigurationParameters()
        cardinalConfigurationParameters.environment = CardinalEnvironment.STAGING
        cardinalConfigurationParameters.requestTimeout = 8000
        cardinalConfigurationParameters.challengeTimeout = 5
		
		val rTYPE = JSONArray()
        rTYPE.put(CardinalRenderType.OTP)
        rTYPE.put(CardinalRenderType.SINGLE_SELECT)
        rTYPE.put(CardinalRenderType.MULTI_SELECT)
        rTYPE.put(CardinalRenderType.OOB)
        rTYPE.put(CardinalRenderType.HTML)
        cardinalConfigurationParameters.renderType = rTYPE

        cardinalConfigurationParameters.uiType = CardinalUiType.BOTH

		val yourUICustomizationObject = UiCustomization()
		cardinalConfigurationParameters.uiCustomization = yourUICustomizationObject

		cardinal.configure(this, cardinalConfigurationParameters)
}


Info
titleSecurity Guide

After you configure cardinalSession, call method getWarnings to get the list of all the warnings for the particular device. Take further action based on the warnings found.

List of warnings can be accessed as follows:

List<Warning> warnings = cardinal.getWarnings();

Goto Security Guidance for detail.


...

MethodDescriptionDefault Values
setEnvironment(CardinalEnvironment environment environment)
Sets the environment the SDK has to connect to
CardinalEnvironment.PRODUCTION
setTimeout(int timeout)  (Deprecated )Sets the maximum amount of time (in milliseconds) for all exchanges
8000
setUiType(CardinalUiType uiType)

Sets all UI types that the device supports for displaying specific challenge user interfaces within the SDK

CardinalUiType.BOTH
setRenderType(org.json.JSONArray JSONArray renderType)

Sets renderLists all UI types that the device supports for displaying specific challenge user interfaces within the SDK


JSONArray rType = new JSONArray();
rType.put(CardinalRenderType.OTP);
rType.put(CardinalRenderType.SINGLE_SELECT);
rType.put(CardinalRenderType.MULTI_SELECT);
rType.put(CardinalRenderType.OOB);
rType.put(CardinalRenderType.HTML);
setProxyAddress(java.lang.String proxyAddress)Sets the proxy the SDK has to connect to
""
setEnableQuickAuth(boolean enableQuickAuth)Sets enable quick auth
false

setUICustomization(UiCustomization UI Customization)

Sets UICustomization      Device Default Values
setEnableDFSync(boolean enableDFSync)On setting true, onSetupCompleted in step 4, will be called after device data collected is sent to the serverfalse
setRequestTimeout(int requestTimeout)Sets the maximum amount of time (milliseconds) for all exchanges8000
setChallengeTimeout(int challengeTimeout)Sets the maximum amount of time (minutes) for challenge5
setThreeDSRequestorAppURL(String threeDSRequestorAppURL)

The setThreeDSRequestorAppURL method may set the 3DS Requestor App URL. If the app sets the URL, then the SDK shall pass the URL to the server.

""

CardinalUiType 
Anchor
CardinalUi
CardinalUi

Enum Constant
BOTH
NATIVE
HTML

CardinalRenderType 
Anchor
CardinalRenderType
CardinalRenderType

Enum Constant and Description
HTML 
MULTI_SELECT
OOB 

OTP

SINGLE_SELECT

CardinalEnvironment 
Anchor
CardinalEnvironment
CardinalEnvironment

Enum Constant
PRODUCTION
STAGING