public final class BamSDK extends MobileSDK
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTRA_CARD_INFORMATION |
static java.lang.String |
EXTRA_ERROR_CODE |
static java.lang.String |
EXTRA_ERROR_MESSAGE |
static java.lang.String |
EXTRA_SCAN_ATTEMPTS |
static int |
REQUEST_CODE |
Modifier and Type | Method and Description |
---|---|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title)
Custom fields the user is asked to fill in to finish a scan.
|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title,
java.util.ArrayList<java.lang.String> values)
Custom fields the user is asked to fill in to finish a scan.
|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title,
java.util.ArrayList<java.lang.String> values,
boolean required)
Custom fields the user is asked to fill in to finish a scan.
|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title,
java.util.ArrayList<java.lang.String> values,
boolean required,
java.lang.String resetValueText)
Custom fields the user is asked to fill in to finish a scan.
|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title,
int inputType)
Custom fields the user is asked to fill in to finish a scan.
|
void |
addCustomField(java.lang.String fieldId,
java.lang.String title,
int inputType,
java.lang.String regex)
Custom fields the user is asked to fill in to finish a scan.
|
void |
clearCustomFields()
Removes all previously added custom fields
|
static BamSDK |
create(android.app.Activity rootActivity,
java.lang.String offlineToken)
Creates an BamSDK instance
|
static BamSDK |
create(android.app.Activity rootActivity,
java.lang.String apiToken,
java.lang.String apiSecret,
JumioDataCenter dataCenter)
Creates an BamSDK instance
|
void |
destroy()
Destroys the instance and frees all resources
|
java.util.ArrayList<CustomField> |
getCustomFields()
get all custom fields as a list
|
android.content.Intent |
getIntent()
Returns the intent to start the SDK activity
|
static boolean |
isSupportedPlatform(android.content.Context context)
Checks if the device platform is supported by the sdk
|
void |
setCameraPosition(JumioCameraPosition cameraPosition)
Set the default camera position
|
void |
setCardHolderNameEditable(boolean cardHolderNameEditable)
User may edit the scanned card holder name (default: false)
|
void |
setCardHolderNameRequired(boolean cardHolderNameRequired)
Enable scanning of card holder name (default: false)
|
void |
setCardNumberMaskingEnabled(boolean cardNumberMaskingEnabled)
The card number is displayed masked on every view (default: true)
|
void |
setCvvRequired(boolean cvvRequired)
Require CVV input by the user (default: true)
|
void |
setEnableFlashOnScanStart(boolean enableFlashOnStartup)
Enable flash on startup
|
void |
setExpiryEditable(boolean expiryEditable)
Set the expiry field mandatory
|
void |
setExpiryRequired(boolean expiryRequired)
Enable scanning of expiry date (default: true)
|
void |
setMerchantReportingCriteria(java.lang.String merchantReportingCriteria)
Identify the scan in your reports.
|
void |
setSortCodeAndAccountNumberRequired(boolean sortCodeAndAccountNumberRequired)
Enable scanning of sort code and account number (default: false)
|
void |
setSoundEffect(int soundResourceId)
Enable sound effect
|
void |
setSupportedCreditCardTypes(java.util.ArrayList<CreditCardType> types)
Specify which card types your app supports by combining NetswipeCreditCardType
|
void |
setVibrationEffectEnabled(boolean vibrationEnabled)
Enable vibration effect
|
void |
start()
Starts the scan.
|
BamCustomScanPresenter |
start(BamCustomScanInterface customScanInterface,
BamCustomScanView customScanView)
Starts the custom scan.
|
getMissingPermissions, getRequiredPermissions, getSDKVersion, hasAllRequiredPermissions, hasPermissionsFor, isRooted, setCustomTheme
public static final java.lang.String EXTRA_CARD_INFORMATION
public static final java.lang.String EXTRA_SCAN_ATTEMPTS
public static final java.lang.String EXTRA_ERROR_CODE
public static final java.lang.String EXTRA_ERROR_MESSAGE
public static int REQUEST_CODE
public static BamSDK create(android.app.Activity rootActivity, java.lang.String apiToken, java.lang.String apiSecret, JumioDataCenter dataCenter) throws PlatformNotSupportedException, java.lang.NullPointerException
rootActivity
- activity which starts the BamSDKapiToken
- The API token of your Jumio merchant accountapiSecret
- The corresponding API secretdataCenter
- Select the JumioDataCenter (US, EU)PlatformNotSupportedException
- if the current platform is not supported by the sdkjava.lang.NullPointerException
- the provided rootActivity must not be nullpublic static BamSDK create(android.app.Activity rootActivity, java.lang.String offlineToken) throws PlatformNotSupportedException, SDKExpiredException, java.lang.NullPointerException
rootActivity
- activity which starts the BamSDKofflineToken
- The offline token of your Jumio merchant accountPlatformNotSupportedException
- if the current platform is not supported by the sdkjava.lang.NullPointerException
- the provided rootActivity must not be nullSDKExpiredException
- if the provided offline token has already expiredpublic static boolean isSupportedPlatform(android.content.Context context)
public void destroy()
public void addCustomField(java.lang.String fieldId, java.lang.String title, int inputType, java.lang.String regex)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldinputType
- Configure a keyboard type for input (constant of android.text.InputType)regex
- Validate field input with a regular expressionpublic void addCustomField(java.lang.String fieldId, java.lang.String title, int inputType)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldinputType
- Configure a keyboard type for input (constant of android.text.InputType)public void addCustomField(java.lang.String fieldId, java.lang.String title, java.util.ArrayList<java.lang.String> values, boolean required, java.lang.String resetValueText)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldvalues
- A list of predefined values, the user will be able to select fromrequired
- Indicates if a selection is required for positive validationresetValueText
- The text that will be shown as first item in spinner component to enablepublic void addCustomField(java.lang.String fieldId, java.lang.String title, java.util.ArrayList<java.lang.String> values, boolean required)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldvalues
- A list of predefined values, the user will be able to select fromrequired
- Indicates if a selection is required for positive validationpublic void addCustomField(java.lang.String fieldId, java.lang.String title, java.util.ArrayList<java.lang.String> values)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldvalues
- a list of predefined values, the user will be able to select frompublic void addCustomField(java.lang.String fieldId, java.lang.String title)
fieldId
- Unique ID of your fieldtitle
- Label text describing the fieldpublic void clearCustomFields()
public java.util.ArrayList<CustomField> getCustomFields()
public void setMerchantReportingCriteria(java.lang.String merchantReportingCriteria)
merchantReportingCriteria
- reporting criteriapublic void setCardHolderNameRequired(boolean cardHolderNameRequired)
cardHolderNameRequired
- enable/disablepublic void setCardHolderNameEditable(boolean cardHolderNameEditable)
cardHolderNameEditable
- enable/disablepublic void setCardNumberMaskingEnabled(boolean cardNumberMaskingEnabled)
cardNumberMaskingEnabled
- enable/disable card number maskingpublic void setSupportedCreditCardTypes(java.util.ArrayList<CreditCardType> types)
types
- supported creditcard typespublic void setExpiryRequired(boolean expiryRequired)
expiryRequired
- enable/disable expiry datepublic void setExpiryEditable(boolean expiryEditable)
expiryEditable
- activate/deactivate mandatory expiry fieldpublic void setCvvRequired(boolean cvvRequired)
cvvRequired
- enable/disable card information inputpublic void setSortCodeAndAccountNumberRequired(boolean sortCodeAndAccountNumberRequired)
sortCodeAndAccountNumberRequired
- enable/disable sort code and account number scanningpublic void setVibrationEffectEnabled(boolean vibrationEnabled)
The device will vibrate shortly if a card is detected.
vibrationEnabled
- enable/disable vibration effectpublic void setSoundEffect(int soundResourceId)
Set the resource Id of a sound file to give a short audio feedback to the user when the card is detected.
soundResourceId
- Resource id of the sound filepublic void setEnableFlashOnScanStart(boolean enableFlashOnStartup)
enableFlashOnStartup
- enable/disablepublic void setCameraPosition(JumioCameraPosition cameraPosition)
cameraPosition
- JumioCameraPositionpublic android.content.Intent getIntent() throws MissingPermissionException
MissingPermissionException
public void start() throws MissingPermissionException
By calling this function, the ScanCardActivity will be started.
start
in class MobileSDK
MissingPermissionException
- if any of the required permissions is not grantedpublic BamCustomScanPresenter start(BamCustomScanInterface customScanInterface, BamCustomScanView customScanView)
customScanInterface
- - implementation of the BamCustomScanInterfacecustomScanView
- - implementation of the BamCustomScanView© Jumio Corp. 268 Lambert Avenue, Palo Alto, CA 94306
The source code and software available on this website (“Software”) is provided by Jumio Corp. or its affiliated group
companies (“Jumio”) "as is” and any express or implied warranties, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose are disclaimed. In no event shall Jumio be liable for any direct, indirect,
incidental, special, exemplary, or consequential damages (including but not limited to procurement of substitute goods or
services, loss of use, data, profits, or business interruption) however caused and on any theory of liability, whether in contract,
strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this Software, even if advised of the
possibility of such damage. In any case, your use of this Software is subject to the terms and conditions that apply to your
contractual relationship with Jumio. As regards Jumio’s privacy practices, please see our privacy notice available here: Privacy Policy.