WePay iOS SDK  7.0.0-prerelease-1
WePay.h
1 //
2 // WePay.h
3 // WePay
4 //
5 // Created by Chaitanya Bagaria on 10/30/14.
6 // Copyright (c) 2014 WePay. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import <UIKit/UIKit.h>
11 
12 #import "WPAddress.h"
13 #import "WPConfig.h"
14 #import "WPPaymentInfo.h"
15 #import "WPPaymentToken.h"
16 #import "WPAuthorizationInfo.h"
17 #import "WPConstantsExternal.h"
18 
19 @class WPConfig;
20 @class WPPaymentInfo;
22 
27 @protocol WPAuthorizationDelegate <NSObject>
28 @required
35 - (void) paymentInfo:(WPPaymentInfo *)paymentInfo
36  didAuthorize:(WPAuthorizationInfo *)authorizationInfo;
37 
44 - (void) paymentInfo:(WPPaymentInfo *)paymentInfo
45 didFailAuthorization:(NSError *)error;
46 
47 @end
48 
52 @protocol WPTokenizationDelegate <NSObject>
53 
60 - (void) paymentInfo:(WPPaymentInfo *)paymentInfo
61  didTokenize:(WPPaymentToken *)paymentToken;
62 
69 - (void) paymentInfo:(WPPaymentInfo *)paymentInfo
70  didFailTokenization:(NSError *)error;
71 
72 
73 @optional
74 
84 - (void) insertPayerEmailWithCompletion:(void (^)(NSString *email))completion;
85 
86 @end
87 
88 
92 @protocol WPCardReaderDelegate <NSObject>
93 @required
103 - (void) selectEMVApplication:(NSArray *)applications
104  completion:(void (^)(NSInteger selectedIndex))completion;
105 
111 - (void) didReadPaymentInfo:(WPPaymentInfo *)paymentInfo;
112 
118 - (void) didFailToReadPaymentInfoWithError:(NSError *)error;
119 
120 
130 - (void) selectCardReader:(NSArray *)cardReaderNames
131  completion:(void (^)(NSInteger selectedIndex))completion;
132 
133 @optional
153 - (void) cardReaderDidChangeStatus:(id)status;
154 
164 - (void) shouldResetCardReaderWithCompletion:(void (^)(BOOL shouldReset))completion;
165 
177 - (void) authorizeAmountWithCompletion:(void (^)(NSDecimalNumber *amount, NSString *currencyCode, long accountId))completion;
178 
179 @end
180 
181 
185 @protocol WPCheckoutDelegate <NSObject>
186 
193 - (void) didStoreSignature:(NSString *)signatureUrl
194  forCheckoutId:(NSString *)checkoutId;
195 
203 - (void) didFailToStoreSignatureImage:(UIImage *)image
204  forCheckoutId:(NSString *)checkoutId
205  withError:(NSError *)error;
206 
207 @end
208 
209 
213 @protocol WPBatteryLevelDelegate <NSObject>
214 
220 - (void) didGetBatteryLevel:(int)batteryLevel;
221 
227 - (void) didFailToGetBatteryLevelwithError:(NSError *)error;
228 
229 @end
230 
231 
235 @interface WePay : NSObject
236 
240 @property (nonatomic, strong, readonly) WPConfig *config;
241 
244 
253 - (instancetype) initWithConfig:(WPConfig *)config;
254 
256 
257 #pragma mark -
258 #pragma mark Tokenization
259 
260 
263 
271 - (void) tokenizePaymentInfo:(WPPaymentInfo *)paymentInfo
272  tokenizationDelegate:(id<WPTokenizationDelegate>)tokenizationDelegate;
273 
275 
276 
277 #pragma mark -
278 #pragma mark Card Reader
279 
282 
300 - (void) startTransactionForReadingWithCardReaderDelegate:(id<WPCardReaderDelegate>) cardReaderDelegate;
301 
320 - (void) startTransactionForTokenizingWithCardReaderDelegate:(id<WPCardReaderDelegate>) cardReaderDelegate
321  tokenizationDelegate:(id<WPTokenizationDelegate>) tokenizationDelegate
322  authorizationDelegate:(id<WPAuthorizationDelegate>) authorizationDelegate;
323 
329 - (void) stopCardReader;
330 
332 
333 #pragma mark -
334 #pragma mark Checkout
335 
338 
350 - (void) storeSignatureImage:(UIImage *)image
351  forCheckoutId:(NSString *)checkoutId
352  checkoutDelegate:(id<WPCheckoutDelegate>) checkoutDelegate;
353 
355 
356 #pragma mark -
357 #pragma mark Battery Level
358 
361 
369 - (void) getCardReaderBatteryLevelWithCardReaderDelegate:(id<WPCardReaderDelegate>) cardReaderDelegate
370  batteryLevelDelegate:(id<WPBatteryLevelDelegate>) batteryLevelDelegate;
371 
373 
374 #pragma mark -
375 #pragma mark Remember card reader
376 
379 
386 - (NSString *) getRememberedCardReader;
387 
392 
394 
395 @end
Definition: WPPaymentToken.h:14
void forgetRememberedCardReader()
Definition: WePay.h:235
void stopCardReader()
Definition: WePay.h:21
WPConfig * config
Definition: WePay.h:240
Definition: WPAuthorizationInfo.h:14
Definition: WPPaymentInfo.h:14
NSString * getRememberedCardReader()
Definition: WPConfig.h:15