Package com.creditcall.chipdnamobile
Class ChipDnaMobileUtils
java.lang.Object
com.creditcall.chipdnamobile.ChipDnaMobileUtils
This class contains utility methods that may be needed to integrate with the
SDK.
- Author:
- Creditcall Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic android.graphics.BitmapgetBitmapFromPngString(String pngString) static StringgetErrorsString(ArrayList<com.creditcall.chipdnamobile.AbstractChipDnaMobileErrorCode> errorCodes) static StringgetSignaturePngStringFromBitmap(android.graphics.Bitmap signatureImage) static booleanisUsbMiuraDevice(android.hardware.usb.UsbDevice device) Check ifUsbDeviceis a Miura PIN padstatic booleanisValidAmount(String amount) Check whether an amount has a valid format.static booleanisValidApiKey(String theApiKey) Check whether the Api Key has a valid format.static booleanisValidEmailAddress(String emailAddress) Check whether an email address has a valid format.static booleanisValidPassword(String password) static booleanisValidPhoneNumber(String phoneNumber) Check whether a phone number has a valid format.static booleanisValidReference(String reference) Check whether a reference string has a valid format.static booleanisValidTerminalID(String terminalId) Check whether the terminal ID has a valid format.static booleanisValidTransactionKey(String transactionKey) Check whether the transaction key has a valid format.static android.graphics.BitmapprocessSignatureImage(android.graphics.Bitmap rawImage)
-
Method Details
-
isValidPhoneNumber
Check whether a phone number has a valid format.- Parameters:
phoneNumber- The phone number to be validated.- Returns:
- True if phone number is valid, false otherwise.
-
isValidEmailAddress
Check whether an email address has a valid format.- Parameters:
emailAddress- The email address to be validated.- Returns:
- True if email is valid, false otherwise.
-
isValidPassword
-
isValidAmount
Check whether an amount has a valid format. It has to be non null, in minor units and have a maximum of 7 numeric digits.- Parameters:
amount- The amount number to be validated.- Returns:
- True if amount is valid, false otherwise.
-
isValidReference
Check whether a reference string has a valid format. It has to contain only UTF-8 characters and have a maximum of 50 characters.- Parameters:
reference- The reference number to be validated.- Returns:
- True if reference is valid, false otherwise.
-
isValidTerminalID
Check whether the terminal ID has a valid format.This must be 8 characters long and only contain numeric characters
- Parameters:
terminalId- The terminal ID to be validated- Returns:
- True if terminal ID is valid, false otherwise.
-
isValidTransactionKey
Check whether the transaction key has a valid format.This should be between 1 and 20 characters long and contain only alpha numeric characters.
- Parameters:
transactionKey- The transaction key to be validated- Returns:
- True if transaction key is valid, false otherwise.
-
isValidApiKey
Check whether the Api Key has a valid format.This should be between exactly 32 characters long and contain only alpha numeric characters.
- Parameters:
theApiKey- The API key to be validated- Returns:
- True if API key is valid, false otherwise.
-
isUsbMiuraDevice
public static boolean isUsbMiuraDevice(android.hardware.usb.UsbDevice device) Check ifUsbDeviceis a Miura PIN pad- Parameters:
device- Device to check- Returns:
- True if USBDevice is a Miura, false otherwise.
-
getErrorsString
-
getSignaturePngStringFromBitmap
public static String getSignaturePngStringFromBitmap(android.graphics.Bitmap signatureImage) throws ChipDnaMobileException - Throws:
ChipDnaMobileException
-
processSignatureImage
public static android.graphics.Bitmap processSignatureImage(android.graphics.Bitmap rawImage) throws ChipDnaMobileException - Throws:
ChipDnaMobileException
-
getBitmapFromPngString
public static android.graphics.Bitmap getBitmapFromPngString(String pngString) throws ChipDnaMobileException - Throws:
ChipDnaMobileException
-