ChipDna Mobile
Loading...
Searching...
No Matches
Class Methods | List of all members
ChipDnaMobileUtils Class Reference

This class contains utility methods that may be needed to integrate with the SDK. More...

#import <ChipDnaMobileUtils.h>

Inherits NSObject.

Class Methods

(BOOL) + isValidEmailAddress:
 
(BOOL) + isValidPhoneNumber:
 
(BOOL) + isValidAmount:
 
(BOOL) + isValidReference:
 
(BOOL) + isValidTerminalID:
 
(BOOL) + isValidTransactionKey:
 
(UIImage *) + processSignature:error:
 
(NSString *) + padLeft:paddingCharacter:desiredLength:
 
(NSString *) + padRight:paddingCharacter:desiredLength:
 

Detailed Description

This class contains utility methods that may be needed to integrate with the SDK.

Author
Creditcall Ltd

Method Documentation

◆ isValidAmount:

+ (BOOL) isValidAmount: (NSString *)  amount

Check whether an amount has a valid format. It has to be non nil, in minor units and have a maximum of 7 numeric digits.

Parameters
amountThe amount number to be validated.
Returns
YES if amount is valid, otherwise NO.

◆ isValidEmailAddress:

+ (BOOL) isValidEmailAddress: (NSString *)  email

Check whether a email address has a valid format.

Parameters
emailThe email address to be validated.
Returns
YES if email is valid, otherwise NO.

◆ isValidPhoneNumber:

+ (BOOL) isValidPhoneNumber: (NSString *)  phoneNumber

Check whether a phone number has a valid format.

Parameters
phoneNumberThe phone number to be validated.
Returns
YES if phone number is valid, otherwise NO.

◆ isValidReference:

+ (BOOL) isValidReference: (NSString *)  reference

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
referenceThe reference number to be validated.
Returns
YES if reference is valid, otherwise NO.

◆ isValidTerminalID:

+ (BOOL) isValidTerminalID: (NSString *)  terminalID

Check whether the terminal ID has a valid format.

This must be 8 characters long and only contain numeric characters.

Parameters
terminalIDThe terminal ID to be validated.
Returns
YES if terminal ID is valid, otherwise NO.

◆ isValidTransactionKey:

+ (BOOL) isValidTransactionKey: (NSString *)  transactionKey

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
transactionKeyThe transaction key to be validated.
Returns
YES if transaction key is valid, otherwise NO.

◆ padLeft:paddingCharacter:desiredLength:

+ (NSString *) padLeft: (NSString *)  originalString
paddingCharacter: (char)  paddingCharacter
desiredLength: (int)  desiredLength 

Pad a string on the left to a desired length with a character of choice.

Parameters
originalStringThe original string to be padded.
paddingCharacterThe character the string is to be padded with.
desiredLengthThe desired legth of the new, padded string.
Returns
The padded string.

◆ padRight:paddingCharacter:desiredLength:

+ (NSString *) padRight: (NSString *)  originalString
paddingCharacter: (char)  paddingCharacter
desiredLength: (int)  desiredLength 

Pad a string on the left to a desired length with a character of choice.

Parameters
originalStringThe original string to be padded.
paddingCharacterThe character the string is to be padded with.
desiredLengthThe desired legth of the new, padded string.
Returns
The padded string.

◆ processSignature:error:

+ (UIImage *) processSignature: (UIImage *)  signatureImage
error: (NSString **)  error 

Validate and resize a signature image.

Method can be called prior to calling ChipDnaMobile#continueSignatureVerification: to resize and validate a captured singature.

Parameters
signatureImageImage of captured signature
errorIf signature fails validation the error parameter will be filled with the error which occured.
Returns
The validated resized image. If validation fails nil will be returned.

The documentation for this class was generated from the following file: