WePay iOS SDK
3.0.0
|
#import <WePay.h>
Instance Methods | |
Initialization | |
(instancetype) | - initWithConfig: |
Tokenization | |
(void) | - tokenizePaymentInfo:tokenizationDelegate: |
Card Reader related methods | |
(void) | - startCardReaderForReadingWithCardReaderDelegate: |
(void) | - startCardReaderForTokenizingWithCardReaderDelegate:tokenizationDelegate: |
(void) | - stopCardReader |
Checkout related methods | |
(void) | - storeSignatureImage:forCheckoutId:checkoutDelegate: |
Properties | |
WPConfig * | config |
Main Class containing all public endpoints.
- (instancetype) initWithConfig: | (WPConfig *) | config |
- (void) startCardReaderForReadingWithCardReaderDelegate: | (id< WPCardReaderDelegate >) | cardReaderDelegate |
Initializes the card reader 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 kWPCardReaderStatusWaitingForSwipe, and the user can try to use the card reader again. This behavior can be configured with WPConfig.
WARNING: When this method is called, 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 the card reader.
cardReaderDelegate | The delegate class which will receive the response(s) for this call. |
- (void) startCardReaderForTokenizingWithCardReaderDelegate: | (id< WPCardReaderDelegate >) | cardReaderDelegate | |
tokenizationDelegate: | (id< WPTokenizationDelegate >) | tokenizationDelegate | |
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 kWPCardReaderStatusWaitingForSwipe, and the user can try to use the card reader again. This behavior can be configured with WPConfig.
WARNING: When this method is called, 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 the card reader.
cardReaderDelegate | The delegate class which will receive the response(s) for this call. |
tokenizationDelegate | The delegate class which will receive the tokenization response(s) for this call. |
- (void) stopCardReader |
Stops the card reader. In response, WPCardReaderDelegate's cardReaderDidChangeStatus: method will be called with kWPCardReaderStatusStopped. Any tokenization in progress will not be stopped, and its result will be delivered to the WPTokenizationDelegate.
- (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. |