STEP 1 Setup your development environment

Before you begin developing your branded mobile wallet app, you must obtain the SDK and configure a development environment supporting its use.

SETUP STEPS:

  1. Install development tools
  2. Import the Android sample app
  3. Configure the SDK instance

1. Install development tools

  1. Download and install Java 8.

  2. Download and install Android Studio as your Integrated Development Environment (IDE) from Android Studio.

  3. Add the following third-party dependencies to your build.gradle file:

    'com.google.android.gms:play-services-wallet:9.2.0'
    'com.android.support:appcompat-v7:23.3.0'
    'com.android.support:design:23.3.0'
    'com.braintreepayments.api:braintree:2.+'
    'com.android.support:support-v4:23.3.0'
    'org.apache.httpcomponents:httpclient:4.0.1'
    

2. Import the Android sample app

  1. Extract the android-sample-app.jar from the Android SDK bundle into your development environment project.

  2. Edit the AndroidManifest.xml file as needed for your project.

    Required Android SDK Version:

    19 or later

    Required Features:

    android.hardware.camera.autofocus

    Required Permissions

    android.permission.INTERNET
    android.permission.READ_PHONE_STATE
    android.permission.ACCESS_NETWORK_STATE
    android.permission.CAMERA
    android.permission.FLASHLIGHT
    android.permission.ACCESS_WIFI_STATE
    
     <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.paydiant.android" android:versionCode="1000" android:versionName="1.0.0">
         <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/>
         <uses-feature android:name="android.hardware.camera.autofocus"/>
         <uses-permission android:name="android.permission.INTERNET"/>
         <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
         <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
         <uses-permission android:name="android.permission.CAMERA"/>
         <uses-permission android:name="android.permission.FLASHLIGHT"/>
         <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
         <application android:label="@string/app_name" android:icon="@drawable/icon" android:name=".common.ApplicationContext" android:theme="@android:style/Theme.NoTitleBar" android:hardwareAccelerated="true">
             <!-- List of Activities -->
             <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="portrait">
             <intent-filter>
             ...
             </intent-filter>
             </activity>
             <activity ....>
             ...
             </activity>
             <!-- List of services -->
             <service android:name="com.paydiant.android.ui.service.logging.PaydiantLoggingService"/>
             <service .... />
         </application>
     </manifest>
     

3. Configure the SDK instance

1. Define the environment variables for your development environment

  • HOST_IP - The host name or IP address where the mobile gateway resides, for example, "sandbox.paydiant.com"

  • HOST_URL - The mobile gateway path relative to the host. The URL suffix should always be /mobile appended to the HOST_IP value. For example, sandbox.paydiant.com/mobile.

  • PROTOCOL - The protocol to be used when calling the mobile gateway (for this version it is "https")

  • appSignature - A unique identifier of the app used to generate the HMAC during signing.

  • apiKey - The unique identifier of the application instance.

      private static final String HOST_IP = "hostname";
      private static final String HOST_URL = HOST_IP + "<URL Suffix>";
      private static final String PROTOCOL = "protocol";
      private ContextWrapper androidContextInstance;
      private byte[] appSignature = new byte[]
      {
          0x6d,
          0x79,
          0x2d,
          0x61,
          0x70,
          0x70
      };
      private byte[] apiKey = new byte[]
      {
          1 a7c, 1 x6d, 0x4 p, 1 x31, 1 x5z, 1 x69
      };
      PaydiantApplicationConfig.getPaydiantApplicationConfig()
          .setupPaydiantApplicationConfig(HOST_URL, PROTOCOL, androidContextInstance,
              appSignature, apiKey);
      

Note: AppSignature and apiKey values must be in byte format, not string.

2. Overload the application context method to set optional configuration values

paydiantSDKConfigProps

Configure encryption and case-sensitivity settings for login password/passcode (PIN)/secret question responses (MFA) to match the corresponding Issuer onboarding settings if encryption will be handled by the SDK:

com.paydiant.android.config.PaydiantApplicationConfig.PASSWORD_ENCRYPTION_KEY("paydiant.mobile.sdk.password.hash.enable") Default = FALSE
com.paydiant.android.config.PaydiantApplicationConfig.PASSCODE_ENCRYPTION_KEY("paydiant.mobile.sdk.passcode.hash.enable") Default = FALSE
com.paydiant.android.config.PaydiantApplicationConfig.MFA_ANSWER_ENCRYPTION_KEY("paydiant.mobile.sdk.mfa.hash.enable") Defautlt = FALSE
com.paydiant.android.config.PaydiantApplicationConfig.MFA_CASE_SENSITIVITY_ENCRYPTION_KEY("paydiant.mobile.sdk.mfa.case.sensitivity.enable") Default = FALSE

Note: Typically, encryption is handled by the server rather than the SDK, so the default value of FALSE is applicable in most cases and explicit configuration is not necessary.

sdkConfigProperties.put(com.paydiant.android.config.PaydiantApplicationConfig.PASSWORD_ENCRYPTION_KEY, false
com.paydiant.android.config.PaydiantApplicationConfig.PASSCODE_ENCRYPTION_KEY, false
com.paydiant.android.config.PaydiantApplicationConfig.MFA_ANSWER_ENCRYPTION_KEY, false
com.paydiant.android.config.PaydiantApplicationConfig.MFA_CASE_SENSITIVITY_KEY, false);

customAppVersionName

Set an alternative application version to override Paydiant’s default a.b.c.d.e versioning format. This custom value will supersede the default setting in the AndroidManifest.

private String customAppVersionName = "5.10"

3. Enable system logging

Paydiant's default logging utility is automatically initialized by the SDK, but it does need to be explicitly added as a service to the AndroidManifest file in order for the SDK to invoke the initialization.

android:name="com.paydiant.android.ui.service.logging.PaydiantLoggingService"

Refer to Paydiant's Android SDK Guide for instructions on implementing a custom logging utility, should your business objectives necessitate it.

NEXT STEP 2: Provide wallet access

Feedback

Have feedback?

Let us know.