WePay iOS SDK  3.0.0
 All Classes Files Functions Variables Enumerations Enumerator Properties Macros
WePay Class Reference

#import <WePay.h>

Inheritance diagram for WePay:

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

WPConfigconfig
 

Detailed Description

Main Class containing all public endpoints.

Method Documentation

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

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

Parameters
cardReaderDelegateThe 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:

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

Parameters
cardReaderDelegateThe delegate class which will receive the response(s) for this call.
tokenizationDelegateThe 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.

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

- (WPConfig*) config
readnonatomicstrong

Your WePay config


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