WePay iOS SDK  7.0.0-beta-2
WPError.h
Go to the documentation of this file.
1 //
2 // WPError.h
3 // WePay
4 //
5 // Created by Chaitanya Bagaria on 12/22/14.
6 // Copyright (c) 2014 WePay. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
27 #pragma mark - WPError constants.
28 
33 FOUNDATION_EXPORT NSString * const kWPErrorAPIDomain;
34 
39 FOUNDATION_EXPORT NSString * const kWPErrorSDKDomain;
40 
44 FOUNDATION_EXPORT NSString * const kWPErrorCategoryKey;
45 
49 FOUNDATION_EXPORT NSString * const kWPErrorCategoryNone;
50 
54 FOUNDATION_EXPORT NSString * const kWPErrorCategoryCardReader;
55 
59 FOUNDATION_EXPORT NSString * const kWPErrorCategoryCardSDK;
60 
61 #pragma mark - Error Codes.
62 
67 typedef enum WPErrorCode {
71  WPErrorUnknown = -10000,
72 
73  // -10001 to -10014 are reserved for legacy error codes
74 
79 
84 
89 
94 
99 
104 
109 
114 
119 
124 
129 
134 
139 
144 
149 
154 
159 
164 
169 
174 
179 
184 
189 
194 
199 
204 
205 
206 
207 } WPErrorCode;
208 
209 #pragma mark - User facing messages.
210 
214 #define WPUnexpectedErrorMessage NSLocalizedStringFromTable(@"There was an unexpected error.", @"WePay", @"There was an unexpected error.");
215 
219 #define WPNoDataReturnedErrorMessage NSLocalizedStringFromTable(@"There was no data returned.", @"WePay", @"There was no data returned.");
220 
224 #define WPCardReaderGeneralErrorMessage NSLocalizedStringFromTable(@"Swipe failed due to: (a) uneven swipe speed, (b) fast swipe, (c) slow swipe, or (d) damaged card.", @"WePay", @"Swipe failed due to: (a) uneven swipe speed, (b) fast swipe, (c) slow swipe, or (d) damaged card.");
225 
229 #define WPCardReaderInitializationErrorMessage NSLocalizedStringFromTable(@"Failed to initialize card reader.", @"WePay", @"Failed to initialize card reader.");
230 
234 #define WPCardReaderTimeoutErrorMessage NSLocalizedStringFromTable(@"Card reader timed out.", @"WePay", @"Card reader timed out.");
235 
239 #define WPSignatureInvalidImageErrorMessage NSLocalizedStringFromTable(@"Inavlid signature image provided.", @"WePay", @"Inavlid signature image provided.");
240 
244 #define WPNameNotFoundErrorMessage NSLocalizedStringFromTable(@"Name not found.", @"WePay", @"Name not found.");
245 
249 #define WPInvalidCardDataErrorMessage NSLocalizedStringFromTable(@"Invalid card data.", @"WePay", @"Invalid card data.");
250 
254 #define WPCardNotSupportedErrorMessage NSLocalizedStringFromTable(@"This card is not supported.", @"WePay", @"This card is not supported.");
255 
259 #define WPInvalidApplicationIdErrorMessage NSLocalizedStringFromTable(@"Invalid application ID selected.", @"WePay", @"Invalid application ID selected.");
260 
264 #define WPDeclinedByCardErrorMessage NSLocalizedStringFromTable(@"The transaction was declined by the card.", @"WePay", @"The transaction was declined by the card.");
265 
269 #define WPCardBlockedErrorMessage NSLocalizedStringFromTable(@"This card has been blocked.", @"WePay", @"This card has been blocked.");
270 
274 #define WPDeclinedByIssuerErrorMessage NSLocalizedStringFromTable(@"The transaction was declined by the issuer bank.", @"WePay", @"The transaction was declined by the issuer bank.");
275 
279 #define WPIssuerUnreachableErrorMessage NSLocalizedStringFromTable(@"The issuing bank could not be reached.", @"WePay", @"The issuing bank could not be reached.");
280 
284 #define WPInvalidAuthInfoErrorMessage NSLocalizedStringFromTable(@"The provided auth info is invalid.", @"WePay", @"The provided auth info is invalid.");
285 
289 #define WPAuthInfoNotProvidedErrorMessage NSLocalizedStringFromTable(@"Auth info was not provided.", @"WePay", @"Auth info was not provided.");
290 
294 #define WPPaymentMethodCannotBeTokenizedErrorMessage NSLocalizedStringFromTable(@"This payment method cannot be tokenized.", @"WePay", @"This payment method cannot be tokenized.");
295 
299 #define WPFailedToGetBatteryLevelErrorMessage NSLocalizedStringFromTable(@"Battery level could not be determined.", @"WePay", @"Battery level could not be determined.");
300 
304 #define WPCardReaderNotConnectedErrorMessage NSLocalizedStringFromTable(@"Card reader is not connected.", @"WePay", @"Card reader is not connected.");
305 
309 #define WPCardReaderModelNotSupportedErrorMessage NSLocalizedStringFromTable(@"This card reader model is not supported.", @"WePay", @"This card reader model is not supported.");
310 
314 #define WPErrorInvalidTransactionAmountErrorMessage NSLocalizedStringFromTable(@"The provided transaction amount is invalid.", @"WePay", @"The provided transaction amount is invalid.");
315 
319 #define WPErrorInvalidTransactionCurrencyCodeErrorMessage NSLocalizedStringFromTable(@"The provided currency code is invalid.", @"WePay", @"The provided currency code is invalid.");
320 
324 #define WPErrorInvalidTransactionAccountIDErrorMessage NSLocalizedStringFromTable(@"The provided account ID is invalid.", @"WePay", @"The provided account ID is invalid.");
325 
329 #define WPErrorInvalidCardReaderSelectionErrorMessage NSLocalizedStringFromTable(@"Card reader selection is invalid.", @"WePay", @"Card reader selection is invalid.");
330 
334 #define WPErrorCardReaderBatteryTooLowErrorMessage NSLocalizedStringFromTable(@"The card reader battery does not have enough charge. Please charge before using.", @"WePay", @"The card reader battery does not have enough charge. Please charge before using.");
Definition: WPError.h:198
Definition: WPError.h:83
FOUNDATION_EXPORT NSString *const kWPErrorCategoryCardSDK
Definition: WPError.h:59
Definition: WPError.h:128
Definition: WPError.h:133
Definition: WPError.h:118
Definition: WPError.h:183
Definition: WPError.h:178
Definition: WPError.h:103
Definition: WPError.h:98
FOUNDATION_EXPORT NSString *const kWPErrorSDKDomain
Definition: WPError.h:39
Definition: WPError.h:148
Definition: WPError.h:138
Definition: WPError.h:113
Definition: WPError.h:78
Definition: WPError.h:93
Definition: WPError.h:71
FOUNDATION_EXPORT NSString *const kWPErrorCategoryNone
Definition: WPError.h:49
FOUNDATION_EXPORT NSString *const kWPErrorCategoryKey
Definition: WPError.h:44
Definition: WPError.h:88
Definition: WPError.h:153
FOUNDATION_EXPORT NSString *const kWPErrorAPIDomain
Definition: WPError.h:33
FOUNDATION_EXPORT NSString *const kWPErrorCategoryCardReader
Definition: WPError.h:54
Definition: WPError.h:143
Definition: WPError.h:173
Definition: WPError.h:188
Definition: WPError.h:168
Definition: WPError.h:163
Definition: WPError.h:193
Definition: WPError.h:123
Definition: WPError.h:203
Definition: WPError.h:158
Definition: WPError.h:108
WPErrorCode
Definition: WPError.h:67