◆ 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
-
completion | The block to be executed with the amount, currency code and merchant account Id for the transaction. |
amount | The 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) |
currencyCode | The 3-character ISO 4217 currency code. The only supported currency code is kWPCurrencyCodeUSD. |
accountId | The WePay account id of the merchant. |
◆ cardReaderDidChangeStatus:()
Called when the card reader changes status.
- Parameters
-
status | Current status of the card reader, one of: kWPCardReaderStatusSearching; kWPCardReaderStatusNotConnected; kWPCardReaderStatusConnected; kWPCardReaderStatusCheckingReader; kWPCardReaderStatusConfiguringReader; kWPCardReaderStatusWaitingForCard; kWPCardReaderStatusShouldNotSwipeEMVCard; kWPCardReaderStatusChipErrorSwipeCard; kWPCardReaderStatusSwipeDetected; kWPCardReaderStatusCardDipped; kWPCardReaderStatusTokenizing; kWPCardReaderStatusAuthorizing; kWPCardReaderStatusStopped; |
◆ didFailToReadPaymentInfoWithError:()
Called when an error occurs while reading a card.
- Parameters
-
error | The error which caused the failure. |
◆ didReadPaymentInfo:()
Called when payment info is successfully obtained from a card.
- Parameters
-
paymentInfo | The 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
-
cardreaderNames | The 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. |
completion | The block to be executed with the index of the selected card reader. |
selectedIndex | The 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
-
applications | The array of NSStrings containing application names from the card. |
completion | The block to be executed with the index of the selected application. |
selectedIndex | The 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
-
completion | The block to be executed with the answer to the question: "Should the card reader be reset?". |
shouldReset | The answer to the question: "Should the card reader be reset?". |
The documentation for this protocol was generated from the following file: