WePay iOS SDK  7.0.0-prerelease-1
<WPCardReaderDelegate > Protocol Reference
Inheritance diagram for <WPCardReaderDelegate >:

Instance Methods

(void) - selectEMVApplication:completion:
 
(void) - didReadPaymentInfo:
 
(void) - didFailToReadPaymentInfoWithError:
 
(void) - selectCardReader:completion:
 
(void) - cardReaderDidChangeStatus:
 
(void) - shouldResetCardReaderWithCompletion:
 
(void) - authorizeAmountWithCompletion:
 

Method Documentation

◆ authorizeAmountWithCompletion:()

- (void WPCardReaderDelegate) authorizeAmountWithCompletion: (void(^)(NSDecimalNumber *amount, NSString *currencyCode, long accountId))  completion
optional

Called when an EMV reader is connected, so that you can provide the amount, currency code and the WePay account Id of the merchant. The transaction cannot proceed until the completion block is executed. Note: In the staging environment, use amounts of 20.61, 120.61, 23.61 and 123.61 to simulate authorization errors. Amounts of 21.61, 121.61, 22.61, 122.61, 24.61, 124.61, 25.61, and 125.61 will simulate successful auth. Example: completion([NSDecimalNumber decimalNumberWithString:"21.61"], kWPCurrencyCodeUSD, 1234567);

Parameters
completionThe block to be executed with the amount, currency code and merchant account Id for the transaction.
amountThe amount for the transaction. For USD amounts, there can be a maximum of two places after the decimal point. (amount.decimalValue._exponent must be >= -2)
currencyCodeThe 3-character ISO 4217 currency code. The only supported currency code is kWPCurrencyCodeUSD.
accountIdThe WePay account id of the merchant.

◆ cardReaderDidChangeStatus:()

- (void WPCardReaderDelegate) cardReaderDidChangeStatus: (id)  status
optional

Called when the card reader changes status.

Parameters
statusCurrent status of the card reader, one of: kWPCardReaderStatusSearching; kWPCardReaderStatusNotConnected; kWPCardReaderStatusConnected; kWPCardReaderStatusCheckingReader; kWPCardReaderStatusConfiguringReader; kWPCardReaderStatusWaitingForCard; kWPCardReaderStatusShouldNotSwipeEMVCard; kWPCardReaderStatusChipErrorSwipeCard; kWPCardReaderStatusSwipeDetected; kWPCardReaderStatusCardDipped; kWPCardReaderStatusTokenizing; kWPCardReaderStatusAuthorizing; kWPCardReaderStatusStopped;

◆ didFailToReadPaymentInfoWithError:()

- (void WPCardReaderDelegate) didFailToReadPaymentInfoWithError: (NSError *)  error
required

Called when an error occurs while reading a card.

Parameters
errorThe error which caused the failure.

◆ didReadPaymentInfo:()

- (void WPCardReaderDelegate) didReadPaymentInfo: (WPPaymentInfo *)  paymentInfo
required

Called when payment info is successfully obtained from a card.

Parameters
paymentInfoThe payment info.

◆ selectCardReader:completion:()

- (void WPCardReaderDelegate) selectCardReader: (NSArray *)  cardReaderNames
completion: (void(^)(NSInteger selectedIndex))  completion 
required

Called after detecting eligible card readers. Either present this card reader list to the merchant, or make some internal default choice. The transaction cannot proceed until the completion block is executed. Example: completion(0);

Parameters
cardreaderNamesThe list of detected card readers. Possible entries include "AUDIOJACK" or "MOB30*", where '*' indicates the last part of the card reader's serial number found on the back of the device.
completionThe block to be executed with the index of the selected card reader.
selectedIndexThe index of the selected card reader in the array of cardReaderNames.

◆ selectEMVApplication:completion:()

- (void WPCardReaderDelegate) selectEMVApplication: (NSArray *)  applications
completion: (void(^)(NSInteger selectedIndex))  completion 
required

Called when the EMV card contains more than one application. The applications should be presented to the payer for selection. Once the payer makes a choice, you need to execute the completion block with the index of the selected application. The transaction cannot proceed until the completion block is executed. Example: completion(0);

Parameters
applicationsThe array of NSStrings containing application names from the card.
completionThe block to be executed with the index of the selected application.
selectedIndexThe index of the selected application in the array of applications from the card.

◆ shouldResetCardReaderWithCompletion:()

- (void WPCardReaderDelegate) shouldResetCardReaderWithCompletion: (void(^)(BOOL shouldReset))  completion
optional

Optionally called when the connected card reader is already configured, to give the app an opportunity to reset the device. If this method is implemented, the transaction cannot proceed until the completion block is executed. The card reader must be reset here if the merchant manually resets the reader via the hardware reset button on the reader. Examples: completion(YES); completion(NO);

Parameters
completionThe block to be executed with the answer to the question: "Should the card reader be reset?".
shouldResetThe answer to the question: "Should the card reader be reset?".

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