iOS SDK

Overview

CardknoxPaymentsSDK is a mobile SDK targeted towards Objective C / Swift mobile application developers; it allows developers to process transactions with the Cardknox Transactions API.

Features

The SDK provides 2 main features:
  1. 1.
    Processing a transaction with the Cardknox user interface. This mode is also called “out of scope.” User is able to process a transaction either through a manual form or through a physical card reader device. The request type, provided by the SDK, contains properties that determine which interface will be displayed. Currently supported card reader is the IDTech VP3300, in Bluetooth mode. The SDK will deliver the transaction processing results to the native application through the NSNotificationCenter.
  2. 2.
    Processing a transaction without the Cardknox user interface. This mode is also called “in scope.” This mode should be used to quickly process a transaction using the Cardknox SDK. Results are given back as a function return value.

Technical Overview

  • The SDK is distributed as a .framework
  • .framework contains the CardknoxPaymentsSDK binary and ObjectiveC .h headers describing the SDK API
  • the CardknoxPaymentsSDK does not contain bitcode and cannot be integrated with applications that require bitcode
  • .framework only supports arm64 64-bit architecture for device builds - simulator targets are not supported
  • SDK minimum deployment target is 9.3

Getting started

To start:
  1. 1.
    Download the .framework
    1. 1.
      Objective-C download can be found here
    2. 2.
      Swift download can be found here
  2. 2.
    add the NSBluetoothAlwaysUsageDescription key to the application Target info.plist file with the content similar to
  3. 3.
    Add it to your XCode project to the application Target:
CardknoxPaymentsSDK.framework added to a sample app Target

SDK API Overview

The CardknoxPaymentsSDK provides the following objects:
  • CardknoxSDK - Used to initialize the CardknoxPaymentsSDK with client metadata, such as client’s software name and software version, as well as with the Cardknox API key to associate processed transactions with. Additionally, the type exposes a handful of lifecycle methods, which are named appropriately with their counterpart in the respective client’s class where they are meant to be called in. It is important for the CardknoxPaymentsSDK lifecycle methods to be in sync with their client’s app lifecycle in order to initialize and dispose of the internal data structures.
  • PaymentTransactionRequest - A request type. Type’s constructor arguments represents the bare minimum of required parameters to make a transaction request against the Cardknox API. Developers can call in scope and out of scope functions on an instance of this type to process a transaction.
  • PaymentTransactionResponse - A response type that is the result of both the in scope and out of scope functions. This object is returned by the in scope function or delivered via the NSNotificationCenter for the out of scope function. For out of scope function, this type offers a utility conversion static method to convert the NSNotification object into an instance of this type.
  • CardknoxCardReaderCallback - A type representing a callback when the SDK is being used to process ‘out of scope’ transactions using a physical card reader device. To receive callbacks back from the SDK, the user needs to subscribe with the NSNotificationCenter by using a tag value on the PaymentTransactionRequest type.
  • CardknoxCallbackCardReaderType - a type containing an enumeration of all possible callback types. Each CardknoxCardReaderCallback object received through the NSNotificationCenter contains one enumeration value.
  • TransactionParameters - used for sending transaction parameters.
Object definitions can be found in the framework’s subfolder Headers in any of the registrar- prefixed files such as registrar-arm64or registrar-x86_64. Registrar files can differ in content, but all of them provide identical definitions for CardknoxPaymentsSDK defined objects.

CardknoxSDK Type

1
@interface CardknoxSDK : NSObject {
2
}
3
-(void) release;
4
-(id) retain;
5
-(uint32_t) xamarinGetGCHandle;
6
-(void) xamarinSetGCHandle: (uint32_t) gchandle;
7
+(void) initWithxSoftwareName:(NSString *)p0 xSoftwareVersion:(NSString *)p1 xVersion:(NSString *)p2;
8
+(void) dealloc;
9
+(void) setPrincipalKey:(NSString *)p0;
10
+(void) applicationWillEnterForeground;
11
+(void) applicationDidEnterBackground;
12
+(void) applicationDidFinishLaunching;
13
-(BOOL) conformsToProtocol:(void *)p0;
14
-(id) init;
15
@end
Copied!
Cardknox SDK Object Definition
Function
Description
initWithxSoftwareName:(NSString *)p0 xSoftwareVersion:(NSString *)p1
xVersion:(NSString *)p2
Configures the SDK with xSoftwareName, xSoftwareVersion and xVersion parameters. These parameters are metadata that describe the client’s application. These parameters will be sent to the Cardknox Gateway at the time of transaction processing.
  • xSoftwareName - Name of your software.
  • xSoftwareVersion - Version of your software.
  • xVersion - Cardknox API version. The current version is 4.5.9.
For an ObjectiveC application, call spot is:
application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Note that this method should be the first method to be called from the CardknoxPaymentsSDK.
Sample Data
1
[CardknoxSDK initWithxSoftwareName:@"development-ios-sdk-sample-app"
2
xSoftwareVersion:@"1.0-alpha-test"
3
xVersion:@"4.5.9"];
Copied!
Function
Description
dealloc
Deallocates/disposes of all CardknoxPaymentsSDK internal data structures.
This method should be called when the CardknoxPaymentsSDK is no longer used; for example when the mobile application is about to terminate.
To use the CardknoxPaymentsSDK again after a call to this method, call the init function on the SDK.
Sample Data
1
- (void)applicationWillTerminate:(UIApplication *)application {
2
    [CardknoxSDK dealloc];
3
}
Copied!
Function
Description
applicationDidFinishLaunching
Attaches the CardknoxPaymentsSDK to the AppDelegate’s lifecycle method.
This method should be called after initWithxSoftwareName method.
Sample Data
1
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2
3
[CardknoxSDK initWithxSoftwareName:@"development-ios-sdk-sample-app"
4
xSoftwareVersion:@"1.0-alpha-test"
5
xVersion:@"4.5.9"];
6
7
[CardknoxSDK applicationDidFinishLaunching];
8
9
return YES;
10
}
Copied!
Function
Description
applicationWillEnterForeground
Attaches the CardknoxPaymentsSDK to the AppDelegate’s lifecycle method.
Sample Data
1
- (void)applicationWillEnterForeground:(UIApplication *)application {
2
[CardknoxSDK applicationWillEnterForeground];
3
}
Copied!
Function
Description
applicationDidEnterBackground
Attaches the CardknoxPaymentsSDK to the AppDelegate’s lifecycle method.
Sample Data
1
- (void)applicationDidEnterBackground:(UIApplication *)application {
2
[CardknoxSDK applicationDidEnterBackground];
3
}
Copied!
Function
Description
setPrincipalKey:(NSString *)p0
Calling this method configures the CardknoxPaymentsSDK to use the specific Cardknox API key for every subsequent transaction processed with the CardknoxPaymentsSDK. If the user wishes to process more transactions with a different Cardknox API, then this is the method that needs to be called.
Sample Data
1
[CardknoxSDK setPrincipalKey:@"ps_demo_cardknox"];
Copied!
CardknoxSDK functions

PaymentTransactionRequest Type

1
@interface PaymentTransactionRequest : NSObject {
2
}
3
@property (nonatomic, assign, readonly) NSString * processOutOfScope_NotificationTag;
4
@property (nonatomic, assign, readonly) NSString * processOutOfScope_CardReaderCallbackNotificationTag;
5
@property (nonatomic, assign) BOOL EnableDeviceInsertSwipeTap;
6
@property (nonatomic, assign) BOOL EnableKeyedEntry;
7
@property (nonatomic, assign, readonly) BOOL isValid;
8
@property (nonatomic, assign, readonly) NSArray * ValidationErrors;
9
-(void) release;
10
-(id) retain;
11
-(uint32_t) xamarinGetGCHandle;
12
-(void) xamarinSetGCHandle: (uint32_t) gchandle;
13
+(NSString *) processOutOfScope_NotificationTag;
14
+(NSString *) processOutOfScope_CardReaderCallbackNotificationTag;
15
+(BOOL) EnableDeviceInsertSwipeTap;
16
+(void) setEnableDeviceInsertSwipeTap:(BOOL)p0;
17
+(BOOL) EnableKeyedEntry;
18
+(void) setEnableKeyedEntry:(BOOL)p0;
19
-(BOOL) isValid;
20
-(NSArray *) ValidationErrors;
21
+(id) createInScopeRequestWithxCommand:(NSString *)p0 transactionParameters:(id)p1;
22
+(id) createOutOfScopeRequestWithxCommand:(NSString *)p0 transactionParameters:(id)p1;
23
-(id) processInScope;
24
-(void) processOutOfScope;
25
-(BOOL) conformsToProtocol:(void *)p0;
26
@end
Copied!
PaymentTransactionRequest object definition
First Tab
Function
Description
processOutOfScope_NotificationTag
Read-only NSString property.
Developers need to use this tag when adding an observer to the NSNotificationCenter in order to receive a PaymentTransactionResponse object prior to invoking the processOutOfScope function.
Sample Data
1
NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
2
3
[notificationCenter addObserver:self
4
selector:@selector(processWithUINotification:)
5
name:[PaymentTransactionRequest processOutOfScope_NotificationTag]
6
object:nil];
Copied!
Function
Description
processOutOfScope_CardReaderCallbackNotificationTag
Read-only NSString property.
Developers need to use this tag when when adding an observer to the NSNotificationCenter in order to receive a CardknoxCardReaderCallback object value from the SDK into the mobile application about the card reader status.
See the CardknoxCardReaderCallbackType type for a list of all possible callbacks.
Sample Data
1
NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
2
3
[notificationCenter addObserver:self
4
selector:@selector(processWithUICardReaderCallbacks:)
5
name:[PaymentTransactionRequest processOutOfScope_CardReaderCallbackNotificationTag]
6
object:nil];
Copied!
Function
Description
isValid
Read-only BOOL property.
Represents the validity of the PaymentTransactionRequest object instance.
Value is computed through PaymentTransactionRequest constructor functions.
Sample Data
True/False
Function
Description
ValidationErrors
Read-only NSArray property.
Value is a nil NSArray when the isValid value is TRUE.
Value is an non-empty NSArray when the isValid value is FALSE. It contains a user-friendly validation error message for each invalid property on the PaymentTransactionRequest object instance.
Sample Data
  1. 1.
    xExp provided value is ““, error is “xExp field is invalid (null, empty or pure whitespace)”
  2. 2.
    xExp provided value is “021”, error is: xExp parameter should be 4 characters long. Expecting 4 digit characters where first 2 digits are months, and second 2 digits year (2/2020 should be passed in as 0220)
  3. 3.
    xExp provided value contains a non-digit or a non-integer value is passed in. For example, if the value is “a03”, the error is: Unable to parse an integer number out of xExp value. Expecting a string with 4 digit characters.
Function
Description
Function
Description
EnableDeviceInsertSwipeTap
BOOL property.
Controls the availability of the swipe screen.
Only for Out of scope request.
Default value: TRUE. See: Additional informations
Sample Data
True/False
PaymentTransactionRequest properties
First Tab
Function
Description
(id) createInScopeRequestWithxCommand: (NSString *) p0 transactionParameters: (TransactionParameters *) p1
Constructor function.
Calling processOutOfScope function is a no-op.
Calling processInScope function will process the transaction with the Cardknox Transactions API and return the response object as a function return value.
Parameter definitions:
  • xAmount
    • a positive double number
  • xCommand
    • supported values: cc:sale, cc:credit, cc:authonly
Function
Description
(id) createOutOfScopeRequestWithxCommand: (NSString *) p0 transactionParameters: (TransactionParameters *) p1
Constructor function.
Calling processOutOfScope function on an instance of this object will show the UI manual entry and/or card reader form to process depends on EnableDeviceInsertSwipeTap and EnableKeyedEntry properties values setted before calling this functions.
Calling processInScope is a no-op.
Object state validity can be read by invoking the (BOOL) isValid function on the same object instance.
In case the object is not valid (i.e., the (BOOL) isValid) function returns NO), the (NSArray *) ValidationErrors property returns an array of validation errors for each invalid parameter.
Parameter definitions:
  • xAmount
    • a positive double number
  • xExp
    • expiration date, in format YYMM
  • xCardNum
    • a non empty string of characters. The SDK does not perform validation about the card type nor about the correct card number format
  • xCommand
    • supported values: cc:sale, cc:credit, cc:authonly
Function
Description
(id) processInScope
Non-static function.
Processes the transaction ‘without user interface.’
The result is a non-nil PaymentTransactionResponse object.
Transaction processing outcome can be determined by reading from the isSuccess property on the response object. In case the object is not in a success state, errorMessage property can be read for more information.
Additionally, developers can read from (BOOL) isValid and (NSArray *) ValidationErrors properties on the PaymentTransactionRequest instance to further determine the case of a response object being in error state.
Sample Data
1
PaymentTransactionResponse * response = [request processInScope];
2
3
// Read the response here
4
bool isSuccess = response.isSuccess;
5
NSString * errorMessage = response.errorMessage;
6
NSString * refNum = response.xRefNum;
7
8
// ... other fields ...
Copied!
Function
Description
(id) processOutOfScope
Non-static function.
Shows the CardknoxPaymentsSDK user interface for transaction processing.
Prior to calling this function, in order to receive transaction processing results, developers need to opt-in for results received through the NSNotificationCenter addObserver method by using the CardknoxPaymentsSDK provided NSString tag called processOutOfScope_NotificationTag, available on the PaymentTransactionRequest type.
Sample Data
1
// Subscribe to "process out of scope" / "with ui" notification
2
NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
3
4
[notificationCenter addObserver:self
5
selector:@selector(processWithUINotification:)
6
name:[PaymentTransactionRequest processOutOfScope_NotificationTag]
7
object:nil];
Copied!
PaymentTransactionRequest functions

PaymentTransactionResponse Type

1
@interface PaymentTransactionResponse : NSObject {
2
}
3
    @property (nonatomic, assign, readonly) BOOL isSuccess;
4
    @property (nonatomic, assign, readonly) NSString * errorMessage;
5
    -(void) release;
6
    -(id) retain;
7
    -(uint32_t) xamarinGetGCHandle;
8
    -(void) xamarinSetGCHandle: (uint32_t) gchandle;
9
    -(BOOL) isSuccess;
10
    -(NSString *) errorMessage;
11
    +(id) unwrap:(NSNotification *)p0;
12
    -(NSString *) xResult;
13
    -(NSString *) xStatus;
14
    -(NSString *) xError;
15
    -(NSString *) xErrorCode;
16
    -(NSString *) xRefNum;
17
    -(NSString *) xExp;
18
    -(NSString *) xDate;
19
    -(NSString *) xAuthCode;
20
    -(NSString *) xBatch;
21
    -(NSString *) xAvsResultCode;
22
    -(NSString *) xAvsResult;
23
    -(NSString *) xCvvResultCode;
24
    -(NSString *) xCvvResult;
25
    -(NSString *) xAuthAmount;
26
    -(NSString *) xToken;
27
    -(NSString *) xMaskedCardNumber;
28
    -(NSString *) xCardType;
29
    -(NSString *) xInvoice;
30
    -(NSString *) xName;
31
    -(NSString *) xCurrency;
32
    -(NSString *) xEntryMethod;
33
    -(NSString *) xRefNumCurrent;
34
    -(BOOL) conformsToProtocol:(void *)p0;
35
@end
Copied!
Property
Description
Sample data
isSuccess
Read-only BOOL property.
TRUE is the PaymentTransactionResponse object whose instance represents a successfully processed transaction; FALSE otherwise.
TRUE / FALSE
errorMessage
Read-only NSString property.
A nil NSString if the isSuccess property is TRUE; otherwise contains a non-nil NSString value with an error message.
Calling the processInScope function on a PaymentTransactionRequest object, which as created with an unsupported xCommand would return a PaymentTransactionResponse object with errorMessage similar to:
Unable to execute method. Object state is invalid. Errors: xCommand provided value is not supported by the SDK. Supported commands are: cc:sale, cc:credit.
xResult
Transaction status
A
E
D
xStatus
Result verbiage
Approved
Error
Declined
xError
Error message, if applicable
See xErrorCode
xErrorCode
Most common error codes: 00000 = Approved 01332 = Duplicate Transaction 1334 = Declined Transaction 01479 = Invalid Card
xRefNum
Cardknox transaction Reference Number. Note: xRefnum is always returned regardless of the outcome of the transaction.
xDate
Time when the transaction was processed.
Value is URL encoded.
Value is localized to the Eastern Time (Abbr. ET) time zone.
Daylight savings are applied.
ET during winter is abbreviated as EST (Eastern Standard Time).
ET during summer is abbreviated as EDT (Eastern Daylight Time).
xDate=4%2f16%2f2021+10%3a14%3a44+AM
xAuthCode
Authorization code, approved transactions only.
xBatch
Batch into which transaction will settle.
xAvsResultCode
The Address Verification Service (AVS) response code.
<code> = <verbiage>
YYY = Address: Match & 5 Digit Zip: Match NYZ = Address: No Match & 5 Digit Zip: Match YNA = Address: Match & 5 Digit Zip: No Match NNN = Address: No Match & 5 Digit Zip: No Match XXU = Address Information not verified for domestic transaction YYX = Address: Match & 9 Digit Zip: Match NYW = Address: No Match & 9 Digit Zip: Match XXR = Retry / System Unavailable XXS = Service Not Supported XXW = Card Number Not On File XXE = Address Verification Not Allowed For Card Type XXG = Global Non-AVS participant YYG = International Address: Match & Zip: Not Compatible GGG = International Address: Match & Zip: Match YGG = International Address: Not Compatible & Zip: Match
xAvsResult
AVS verbiage.
See xAvsResultCode sample data.
xCvvResultCode
Card Code Verification (CCV) response code.
<code> = <verbiage>
M = Match N = No Match P = Not Processed S = Should be on card, but not so indicated U = Issuer Not Certified X = No Response from Association
xCvvResult
CVV verbiage.
See xAvsResult sample data.
xAuthAmount
The total amount authorized, inclusive of tax and tip (if applicable).
xToken
Token returned for use with future transaction.
xMaskedCardNumber
A masked version of the credit card used for the transaction.
xCardType
Type of credit card used for the transaction.
Unknown EBT GiftCard Amex Visa MasterCard Discover Diners JCB
PaymentTransactionResponse properties
PaymentTransactionResponse
Function
Description
(id) unwrap:(NSNotification *)p0
Static function.
Utility method to extract the PaymentTransactionResponse object from a NSNotification object when processing transactions with PaymentTransactionRequest processOutOfScope function.
Sample Data
1
-(void)processWithUINotification:(NSNotification*)aNotification{
2
3
// Unwrap
4
PaymentTransactionResponse * response = [PaymentTransactionResponse unwrap:aNotification];
5
6
if(response.isSuccess)
7
{
8
// Transaction successfully processed
9
10
// Always empty/nil on success
11
NSString * errorMessage = response.errorMessage;
12
13
NSString * refNum = response.xRefNum;
14
15
// ... other properties ...
16
}
17
else
18
{
19
// Transaction processing resulted in an error; message can be extracted from this property:
20
NSString * error = response.errorMessage;
21
22
// All other fields are null
23
}
24
}
Copied!
PaymentTransactionResponse functions

CardknoxCardReaderCallback type

1
/@interface CardknoxCardReaderCallback : NSObject {
2
}
3
-(void) release;
4
-(id) retain;
5
-(uint32_t) xamarinGetGCHandle;
6
-(void) xamarinSetGCHandle: (uint32_t) gchandle;
7
-(int) code;
8
+(id) unwrap:(NSNotification *)p0;
9
-(BOOL) conformsToProtocol:(void *)p0;
10
@end
Copied!
Property
Description & sample data
(int) code
One of the property values on the CardknoxCardReaderCallbackType type.
1
// Use the utility method to unwrap the NSNotification object
2
CardknoxCardReaderCallback* callback = [CardknoxCardReaderCallback unwrap:callbackNotification];
3
4
// Read the code
5
int code = callback.code;
6
7
// Match the code against provided 'types'
8
if(code == CardknoxCardReaderCallbackType.connected){
9
NSLog(@"Card reader - connected");
Copied!
CardknoxCardReaderCallback properties
Function
Description
+(id) unwrap:(NSNotification *)p0;
A utility method to convert an NSNotification object into a CardknoxCardReaderCallback object.
1
// Use the utility method to unwrap the NSNotification object
2
CardknoxCardReaderCallback* callback = [CardknoxCardReaderCallback unwrap:callbackNotification];
3
4
// Read the code
5
int code = callback.code;
6
7
// Match the code against provided 'types'
8
if(code == CardknoxCardReaderCallbackType.connected){
9
NSLog(@"Card reader - connected");
Copied!
CardknoxCardReaderCallback functions

CardknoxCardReaderCallbackType type

1
@interface CardknoxCardReaderCallbackType : NSObject {
2
}
3
@property (nonatomic, assign, readonly) int connected;
4
@property (nonatomic, assign, readonly) int connecting;
5
@property (nonatomic, assign, readonly) int connectingTimeout;
6
@property (nonatomic, assign, readonly) int disconnected;
7
@property (nonatomic, assign, readonly) int transactionStarted;
8
@property (nonatomic, assign, readonly) int transactionCancelled;
9
@property (nonatomic, assign, readonly) int errorCardReadTimeout;
10
@property (nonatomic, assign, readonly) int errorEMVCardDeclined;
11
@property (nonatomic, assign, readonly) int errorEMVGenericError;
12
@property (nonatomic, assign, readonly) int errorMSRGenericError;
13
-(void) release;
14
-(id) retain;
15
-(uint32_t) xamarinGetGCHandle;
16
-(void) xamarinSetGCHandle: (uint32_t) gchandle;
17
+(int) connected;
18
+(int) connecting;
19
+(int) connectingTimeout;
20
+(int) disconnected;
21
+(int) transactionStarted;
22
+(int) transactionCancelled;
23
+(int) errorCardReadTimeout;
24
+(int) errorEMVCardDeclined;
25
+(int) errorEMVGenericError;
26
+(int) errorMSRGenericError;
27
-(BOOL) conformsToProtocol:(void *)p0;
28
-(id) init;
29
@end
Copied!
CardknoxCardReaderCallbackType object definition
Property
Description
connected
Raised when the CardknoxPaymentsSDK successfully discovers and connects to the physical card reader device.
connecting
Raised when the CardknoxPaymentsSDK initiates a discovery process, such as a bluetooth scan, in order to find and connect to the physical card reader device.
The discovery process lasts for 15 seconds.
connectingTimeout
Raised when the CardknoxPaymentsSDK initiates a discovery process, such as a bluetooth scan, in order to find a physical card reader device to connect to - but the discovery process times out.
disconnected
Raised when the physical card reader device raises a disconnected event.
transactionStarted
Raised when the transaction with the physical card reader is started and the card reader is ready to accept a card to read from.
transactionCancelled
Raised when the already started transaction with the physical card reader is cancelled.
For example, this callback is raised if there is an already started transaction and the CardknoxPaymentsSDK UI is closed.
errorCardReadTimeout
Raised when the card reader timed out when a physical card was either inserted into (EMV contact), tapped onto (EMV contactless) or swiped through (MSR) the physical card reader device.
A transaction with a card reader has to be established prior to this event potentially happening.
errorEMVCardDeclined
Raised when the physical card reader device declined an EMV card, for various reasons, during the card reading process.
Most often, a new transaction with the card reader will have to be established to read the card again.
errorEMVGenericError
A generic callback for EMV card reading errors.
errorMSRGenericError
A generic callback for MSR card reading errors.
Sample code for subscribing to the callbacks.
1
-(void)processWithUICardReaderCallbacks:(NSNotification*)callbackNotification{
2
3
// Use the utility method to unwrap the NSNotification object
4
CardknoxCardReaderCallback* callback = [CardknoxCardReaderCallback unwrap:callbackNotification];
5
6
// Read the code
7
int code = callback.code;
8
9
// Match the code against provided 'types'
10
if(code == CardknoxCardReaderCallbackType.connected){
11
NSLog(@"Card reader - connected");
12
} else if(code == CardknoxCardReaderCallbackType.connecting){
13
NSLog(@"Card reader - connecting");
14
} else if(code == CardknoxCardReaderCallbackType.connectingTimeout) {
15
NSLog(@"Card reader - connecting timeout");
16
} else if(code == CardknoxCardReaderCallbackType.disconnected) {
17
NSLog(@"Card reader - disconnected");
18
} else if(code == CardknoxCardReaderCallbackType.transactionStarted) {
19
NSLog(@"Card reader - transaction started");
20
} else if(code == CardknoxCardReaderCallbackType.transactionCancelled) {
21
NSLog(@"Card reader - transaction cancelled");
22
} else if(code == CardknoxCardReaderCallbackType.errorCardReadTimeout){
23
NSLog(@"Card reader - card read timed out when the card was tapped/inserted/swipe on the reader");
24
} else if(code == CardknoxCardReaderCallbackType.errorEMVCardDeclined){
25
NSLog(@"Card reader - EMV card got declined!");
26
} else if(code == CardknoxCardReaderCallbackType.errorEMVGenericError){
27
NSLog(@"Card reader - EMV generic error occurred. Errors are logged in the SDK");
28
} else if(code == CardknoxCardReaderCallbackType.errorMSRGenericError){
29
NSLog(@"Card reader - MSR generic error occurred. Errors are logged in the SDK");
30
}
31
else {
32
NSLog(@"Card reader - unknown code occurred!");
33
}
34
}
Copied!