WePay iOS SDK
7.0.0-prerelease-1
|
#import <WePay.h>
Instance Methods | |
Initialization | |
(instancetype) | - initWithConfig: |
Tokenization | |
(void) | - tokenizePaymentInfo:tokenizationDelegate: |
Card Reader related methods | |
(void) | - startTransactionForReadingWithCardReaderDelegate: |
(void) | - startTransactionForTokenizingWithCardReaderDelegate:tokenizationDelegate:authorizationDelegate: |
(void) | - stopCardReader |
Checkout related methods | |
(void) | - storeSignatureImage:forCheckoutId:checkoutDelegate: |
Battery Level related methods | |
(void) | - getCardReaderBatteryLevelWithCardReaderDelegate:batteryLevelDelegate: |
Remember card reader related methods | |
(NSString *) | - getRememberedCardReader |
(void) | - forgetRememberedCardReader |
Properties | |
WPConfig * | config |
Main Class containing all public endpoints.
- (void) forgetRememberedCardReader |
Clears the name of the most recently used card reader.
- (void) getCardReaderBatteryLevelWithCardReaderDelegate: | (id< WPCardReaderDelegate >) | cardReaderDelegate | |
batteryLevelDelegate: | (id< WPBatteryLevelDelegate >) | batteryLevelDelegate | |
Gets the current battery level of the card reader.
cardReaderDelegate | the delegate class which will receive the card reader response(s) for this call. |
batteryLevelDelegate | the delegate class which will receive the battery level response(s) for this call. |
- (NSString *) getRememberedCardReader |
Gets the name of the most recently used card reader.
- (instancetype) initWithConfig: | (WPConfig *) | config |
- (void) startTransactionForReadingWithCardReaderDelegate: | (id< WPCardReaderDelegate >) | cardReaderDelegate |
Initializes the transaction for reading card info.
The card reader will wait 60 seconds for a card, and then return a timout error if a card is not detected. The card reader will automatically stop waiting for card if:
However, if a general error (domain:kWPErrorCategoryCardReader, errorCode:WPErrorCardReaderGeneralError) occurs while reading, after a few seconds delay, the card reader will automatically start waiting again for another 60 seconds. At that time, WPCardReaderDelegate's cardReaderDidChangeStatus: method will be called with kWPCardReaderStatusWaitingForCard, and the user can try to use the card reader again. This behavior can be configured with WPConfig.
WARNING: When this method is called, if the "AUDIOJACK" device is selected via the onReaderSelection: method in WPCardReaderDelegate, a (normally inaudible) signal is sent to the headphone jack of the phone, where the card reader is expected to be connected. If headphones are connected instead of the card reader, they may emit a very loud audible tone on receiving this signal. This method should only be called when the user intends to use a card reader.
cardReaderDelegate | The delegate class which will receive the response(s) for this call. |
- (void) startTransactionForTokenizingWithCardReaderDelegate: | (id< WPCardReaderDelegate >) | cardReaderDelegate | |
tokenizationDelegate: | (id< WPTokenizationDelegate >) | tokenizationDelegate | |
authorizationDelegate: | (id< WPAuthorizationDelegate >) | authorizationDelegate | |
Initializes the card reader for reading and then automatically tokenizing card info. If an EMV card is dipped into a connected EMV reader, the card will automatically be authorized.
The card reader will wait 60 seconds for a card, and then return a timout error if a card is not detected. The card reader will automatically stop waiting for card if:
However, if a general error (domain:kWPErrorCategoryCardReader, errorCode:WPErrorCardReaderGeneralError) occurs while reading, after a few seconds delay, the card reader will automatically start waiting again for another 60 seconds. At that time, WPCardReaderDelegate's cardReaderDidChangeStatus: method will be called with kWPCardReaderStatusWaitingForCard, and the user can try to use the card reader again. This behavior can be configured with WPConfig.
WARNING: When this method is called, if the "AUDIOJACK" device is selected via the onReaderSelection: method in WPCardReaderDelegate, a (normally inaudible) signal is sent to the headphone jack of the phone, where the card reader is expected to be connected. If headphones are connected instead of the card reader, they may emit a very loud audible tone on receiving this signal. This method should only be called when the user intends to use a card reader.
cardReaderDelegate | The delegate class which will receive the card reader response(s) for this call. |
tokenizationDelegate | The delegate class which will receive the tokenization response(s) for this call. |
authorizationDelegate | The delegate class which will receive the authorization response(s) for this call. |
- (void) stopCardReader |
Stops the card reader. In response, WPCardReaderDelegate's cardReaderDidChangeStatus: method will be called with kWPCardReaderStatusStopped. The status can only be returned if you've provided a WPCardReaderDelegate by starting a card reader operation after the WePay object was initialized. Any operation in progress may not stop, and its result will be delivered to the appropriate delegate.
- (void) storeSignatureImage: | (UIImage *) | image | |
forCheckoutId: | (NSString *) | checkoutId | |
checkoutDelegate: | (id< WPCheckoutDelegate >) | checkoutDelegate | |
Stores a signature image associated with a checkout id on WePay's servers. The signature can be retrieved via a server-to-server call that fetches the checkout object. The aspect ratio (width:height) of the image must be between 1:4 and 4:1. If needed, the image will internally be scaled to fit inside 256x256 pixels, while maintaining the original aspect ratio.
image | The signature image to be stored. |
checkoutId | The checkout id associated with this transaction. |
checkoutDelegate | The delegate class which will receive the response(s) for this call. |
- (void) tokenizePaymentInfo: | (WPPaymentInfo *) | paymentInfo | |
tokenizationDelegate: | (id< WPTokenizationDelegate >) | tokenizationDelegate | |
Creates a payment token from a WPPaymentInfo object.
paymentInfo | The payment info obtained from the user in any form. |
tokenizationDelegate | The delegate class which will receive the tokenization response(s) for this call. |