WePay iOS SDK  7.0.0-prerelease-1
WePay Class Reference

#import <WePay.h>

Inheritance diagram for WePay:

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

WPConfigconfig
 

Detailed Description

Main Class containing all public endpoints.

Method Documentation

◆ forgetRememberedCardReader()

- (void) forgetRememberedCardReader

Clears the name of the most recently used card reader.

◆ getCardReaderBatteryLevelWithCardReaderDelegate:batteryLevelDelegate:()

- (void) getCardReaderBatteryLevelWithCardReaderDelegate: (id< WPCardReaderDelegate >)  cardReaderDelegate
batteryLevelDelegate: (id< WPBatteryLevelDelegate >)  batteryLevelDelegate 

Gets the current battery level of the card reader.

Parameters
cardReaderDelegatethe delegate class which will receive the card reader response(s) for this call.
batteryLevelDelegatethe delegate class which will receive the battery level response(s) for this call.

◆ getRememberedCardReader()

- (NSString *) getRememberedCardReader

Gets the name of the most recently used card reader.

Returns
the name of the card reader.

◆ initWithConfig:()

- (instancetype) initWithConfig: (WPConfig *)  config

The designated intializer. Use this to initialize the SDK.

Parameters
configA WPConfig instance.
Returns
A WePay instance, which can be used to access most of the functionality of this sdk.

◆ startTransactionForReadingWithCardReaderDelegate:()

- (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:

  • a timeout occurs
  • a card is successfully detected
  • an unexpected error occurs
  • stopCardReader is called

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.

Parameters
cardReaderDelegateThe delegate class which will receive the response(s) for this call.

◆ startTransactionForTokenizingWithCardReaderDelegate:tokenizationDelegate:authorizationDelegate:()

- (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:

  • a timeout occurs
  • a card is successfully detected
  • an unexpected error occurs
  • stopCardReader is called

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.

Parameters
cardReaderDelegateThe delegate class which will receive the card reader response(s) for this call.
tokenizationDelegateThe delegate class which will receive the tokenization response(s) for this call.
authorizationDelegateThe delegate class which will receive the authorization response(s) for this call.

◆ stopCardReader()

- (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.

◆ storeSignatureImage:forCheckoutId:checkoutDelegate:()

- (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.

Parameters
imageThe signature image to be stored.
checkoutIdThe checkout id associated with this transaction.
checkoutDelegateThe delegate class which will receive the response(s) for this call.

◆ tokenizePaymentInfo:tokenizationDelegate:()

- (void) tokenizePaymentInfo: (WPPaymentInfo *)  paymentInfo
tokenizationDelegate: (id< WPTokenizationDelegate >)  tokenizationDelegate 

Creates a payment token from a WPPaymentInfo object.

Parameters
paymentInfoThe payment info obtained from the user in any form.
tokenizationDelegateThe delegate class which will receive the tokenization response(s) for this call.

Property Documentation

◆ config

- (WPConfig*) config
readnonatomicstrong

Your WePay config


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