You are on page 1of 9

Netswipe Mobile Implementation

Guide for Android


This guide is a reference manual and configuration guide for the
Netswipe Mobile product. It illustrates how to embed the SDK into
your app.










Copyright:
Jumio Inc. 268 Lambert Avenue, Palo Alto, CA 94306



2
Contents
Netswipe Mobile Implementation Guide for Android ............................................................... 1
Contents .................................................................................................................................. 2
Release notes ...................................................................................................................... 3
Contact ................................................................................................................................ 3
Setup ....................................................................................................................................... 4
Integration .............................................................................................................................. 4
Initializing the SDK .............................................................................................................. 5
Configuring the SDK ............................................................................................................ 5
Localizing labels ................................................................................................................... 6
Customizing look and feel ................................................................................................... 6
Displaying the SDK .............................................................................................................. 6
Retrieving information ........................................................................................................ 7
Netswipe Retrieval API ........................................................................................................... 8
Two-factor authentication ...................................................................................................... 9




3
Release notes
The current version of the Jumio SDK is 1.2.1. Visit Netswipe Mobile Release Notes to see
additions, changes and fixes included in each release.
Contact
If you have any questions regarding our implementation guide please contact Jumio
Customer Service at support@jumio.com or https://support.jumio.com. The Jumio online
helpdesk contains a wealth of information regarding our service including demo videos,
product descriptions, FAQs and other things that may help to get you started with Jumio.
Check it out at: https://support.jumio.com.



4
Setup
The minimum requirements for the SDK are:
Android 4.0 (API level 14)
ARMv7 processor with Neon
Internet connection, communication via standard SSL port 443

The following permissions are required by the SDK:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera.autofocus"
android:required="false"/>

The following permissions are optional:
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:name="android.hardware.camera" android:required="true"/>

Using the SDK requires an activity declaration in your AndroidManifest.xml. The orientation
can be sensor based or locked with the attribute android:screenOrientation.

<activity
android:theme="@style/Theme.Netswipe"
android:hardwareAccelerated="true"
android:name="com.jumio.netswipe.sdk.activity.ScanCardActivity"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"/>

If you are using Proguard, add the following lines in its configuration.

-keep class com.jumio.** { *; }
-keep class jumiomobile.** { *; }
Integration
Use the SDK in your application by including the JumioMobileSDK and NetswipeResources
library projects. Check the Android sample project to learn the most common use.

Note: If you are also using Netverify in your app, make sure to include JumioMobileSDK only
once.

Applications implementing the SDK shall not run on rooted devices
1
. Use either the below
method or a self-devised check to prevent usage of SDK scanning functionality on rooted
devices.

NetswipeSDK.isRooted()


1
In case of doubt, please consult a PCI QSA (Qualified Security Assessor).


5
Use the method isSupportedPlatform to check if the device is supported (camera available,
ARMv7 processor with Neon, Android 4.0 or higher).

NetswipeSDK.isSupportedPlatform(this)
Initializing the SDK
To create an instance of the SDK, perform the following call.

NetswipeSDK sdk = new NetswipeSDK(yourActivity, "YOURAPITOKEN", "YOURAPISECRET",
"YOURREPORTINGCRITERIA");

Make sure that your merchant API token and API secret are correct, specify an instance
of your activity and provide a reference to identify the scans in your reports (max. 100
characters or null).

Note: Log into https://netswipe.com, and you can find your merchant API token and API
secret on the "Settings" page under "API credentials". We strongly recommend you to store
credentials outside your app.
Configuring the SDK
Overwrite your specified reporting criteria to identify each scan attempt in your reports
(max. 100 characters).

sdk.setMerchantReportingCriteria("YOURREPORTINGCRITERIA");

To restrict supported card types, pass an ArrayList of CreditCardTypes to the
setSupportedCreditCardTypes method.

ArrayList<CreditCardType> creditCardTypes = new ArrayList<CreditCardType>();
creditCardTypes.add(CreditCardType.VISA);
creditCardTypes.add(CreditCardType.MASTER_CARD);
sdk.setSupportedCreditCardTypes(creditCardTypes);

You can enable the recognition of card holder name, sort code and account number.
Manual entry, expiry recognition and CVV entry are enabled by default and can be disabled.

sdk.setCardHolderNameRequired(true);
sdk.setSortCodeAndAccountNumberRequired(true)
sdk.setManualEntryEnabled(false);
sdk.setExpiryRequired(false);
sdk.setCvvRequired(false);

Use setName to pass first and last name for name match if card holder recognition is enabled.
The user can edit the recognized card holder name if setCardHolderNameEditable is enabled.

sdk.setName("FIRSTNAME LASTNAME");
sdk.setCardHolderNameEditable(true);




6
You can set a short vibration and sound effect to notify the user that the card has been
detected.

sdk.setVibrationEffectEnabled(true);
sdk.setSoundEffect(R.raw.yoursoundfile);

To show the unmasked card number during the user journey, disable the following setting.

sdk.setCardNumberMaskingEnabled(false);

You can add fields to "Manual entry" and the confirmation page.

sdk.addCustomField("idZipCode", "Zip code", "94306", InputType.TYPE_CLASS_NUMBER,
"YOURREGULAREXPRESSION");
Localizing labels
All label texts and button titles can be changed and localized using the standard strings.xml
file. Just add the Netswipe strings and adapt them to your required language (see
JumioMobileSample/res/values/strings.xml).
Customizing look and feel
The SDK can be customized to fit your applications look and feel by specifying
Theme.Netswipe as a parent style of your own theme, or by editing the
NetswipeResources/res/values/styles.xml file.
Submit button: title color and background color
Action Bar: title color, background and back button image

To change button and background image for "Manual entry", replace the following files.

NetswipeResources/res/drawable-xhdpi/netswipe_icon_manual_entry.png
NetswipeResources/res/drawable-hdpi/netswipe_icon_manual_entry.png
NetswipeResources/res/drawable-xhdpi/netswipe_background_manual_entry.png
NetswipeResources/res/drawable-hdpi/netswipe_background_manual_entry.png

You can also replace the error image.

NetswipeResources/res/drawable-xhdpi/netswipe_info_view_error.png
Displaying the SDK
To show the SDK, call the respective method below within your activity or fragment.

Activity: sdk.start();
Fragment: startActivityForResult(sdk.getIntent(), NetswipeSDK.REQUEST_CODE);

Note: The default request code is 100. To use another code, override the public static
variable NetswipeSDK.REQUEST_CODE before displaying the SDK.


7
Retrieving information
Implement the standard method onActivityResult in your activity for successful scans and
user cancellation notifications.

You receive a Jumio scan reference for each try, if the Internet connection is available.
Offline scans will not be part of the Arraylist scanReferences.

Call clear() after processing the card information to make sure no sensitive data remains in
the device's memory.

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == NetswipeSDK.REQUEST_CODE) {
// ArrayList<String> scanReferences =
data.getStringArrayListExtra(NetswipeSDK.EXTRA_SCAN_ATTEMPTS);
// YOURCODE
if (resultCode == Activity.RESULT_OK) {
// NetswipeCardInformation cardInformation =
data.getParcelableExtra(NetswipeSDK.EXTRA_CARD_INFORMATION);
// CreditCardType cardType = cardInformation.getCardType();
// char[] cardNumber = cardInformation.getCardNumber();
// char[] cardNumberGrouped =
cardInformation.getCardNumberGrouped();
// char[] cardNumberMasked =
cardInformation.getCardNumberMasked();
// boolean cardNumberManuallyEntered =
cardInformation.isCardNumberManuallyEntered();
// char[] cardExpiryMonth =
cardInformation.getCardExpiryDateMonth();
// char[] cardExpiryYear =
cardInformation.getCardExpiryDateYear();
// char[] cardExpiryDate = cardInformation.getCardExpiryDate();
// char[] cardCvv = cardInformation.getCardCvvCode();
// char[] cardHolderName = cardInformation.getCardHolderName();
// char[] cardSortCode = cardInformation.getCardSortCode();
// char[] cardAccountNumber =
cardInformation.getCardAccountNumber();
// boolean cardSortCodeValid =
cardInformation.getCardSortCodeValid();
// boolean cardAccountNumberValid =
cardInformation.getCardAccountNumberValid();
// boolean nameMatch = cardInformation.getNameMatch();
// int nameDistance = cardInformation.getNameDistance();
// String zipCode = cardInformation.getCustomField("idZipCode");
// YOURCODE
// cardInformation.clear();
}
else if (resultCode == Activity.RESULT_CANCELED) {
// int errorCode = data.getIntExtra(NetswipeSDK.EXTRA_ERROR_CODE,
0);
// String errorMessage =
data.getStringExtra(NetswipeSDK.EXTRA_ERROR_MESSAGE);
// YOURCODE
}
}
}




8
Class NetswipeCardInformation

Parameter Type Max.
length
Description
cardType
CreditC
ardType
VISA, MASTER_CARD, AMERICAN_EXPRESS,
DINERS_CLUB, DISCOVER, CHINA_UNIONPAY, or JCB
cardNumber
char[]
16 Full credit card number
cardNumberGrouped
char[]
19 Grouped credit card number
cardNumberMasked
char[]
19 First 6 and last 4 digits of the grouped credit card
number, other digits are masked with "X"
cardNumberManuallyEntered
boolean
True if manual entry, otherwise false
cardExpiryMonth
char[]
2 Month card expires, 2 digits, if enabled and readable
cardExpiryYear
char[]
2 Year card expires, 2 digits, if enabled and readable
cardExpiryDate
char[]
5 Date card expires in the format MM/yy, if enabled and
readable
cardCVV
char[]
4 Entered CVV, if enabled
cardHolderName
char[]
100 Name of the card holder in capital letters, if enabled
cardSortCode
char[]
8 Sort code in the format xx-xx-xx, if enabled
cardAccountNumber
char[]
8 Account number, if enabled
cardSortCodeValid
boolean
True if sort code valid, otherwise false
cardAccountNumberValid
boolean
True if account number code valid, otherwise false
nameMatch
boolean
True if successful name match (nameDistance <= 20 %
of name length), otherwise false
nameDistance
int
Levenshtein distance for name match, otherwise -1

Method Parameter type Return type Description
clear - - Clear card information
getCustomField
String String
Get entered value for added field

Error codes

Code Message Description
300 Your card type is not accepted Retry possible, user decided to cancel
310 Background execution is not supported Cancellation triggered automatically
320 Your card is expired Retry possible, user decided to cancel
210
220
Authentication failed API credentials invalid, retry impossible
240 Scanning not available at this time, please contact the
app vendor
Resources cannot be loaded, retry
impossible
250 Canceled by end-user No error occurred
260 The camera is currently not available Camera cannot be initialized, retry
impossible
Netswipe Retrieval API
You can implement RESTful HTTP GET APIs to retrieve credit card image and data for a
specific scan. Find the Implementation Guide at the link below.
http://www.jumio.com/implementation-guides/netswipe-retrieval-api/.


9
Two-factor authentication
If you want to enable two-factor authentication for your Jumio merchant backend please
contact support@jumio.com. Once enabled, users will be guided through the setup upon
their first login to obtain a security code using the "Google Authenticator" app.