WePay iOS SDK  7.0.0-prerelease-1
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 
209 
210 } WPErrorCode;
211 
212 #pragma mark - User facing messages.
213 
217 #define WPUnexpectedErrorMessage NSLocalizedStringFromTable(@"There was an unexpected error.", @"WePay", @"There was an unexpected error.");
218 
222 #define WPNoDataReturnedErrorMessage NSLocalizedStringFromTable(@"There was no data returned.", @"WePay", @"There was no data returned.");
223 
227 #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.");
228 
232 #define WPCardReaderInitializationErrorMessage NSLocalizedStringFromTable(@"Failed to initialize card reader.", @"WePay", @"Failed to initialize card reader.");
233 
237 #define WPCardReaderTimeoutErrorMessage NSLocalizedStringFromTable(@"Card reader timed out.", @"WePay", @"Card reader timed out.");
238 
242 #define WPSignatureInvalidImageErrorMessage NSLocalizedStringFromTable(@"Inavlid signature image provided.", @"WePay", @"Inavlid signature image provided.");
243 
247 #define WPNameNotFoundErrorMessage NSLocalizedStringFromTable(@"Name not found.", @"WePay", @"Name not found.");
248 
252 #define WPInvalidCardDataErrorMessage NSLocalizedStringFromTable(@"Invalid card data.", @"WePay", @"Invalid card data.");
253 
257 #define WPCardNotSupportedErrorMessage NSLocalizedStringFromTable(@"This card is not supported.", @"WePay", @"This card is not supported.");
258 
262 #define WPInvalidApplicationIdErrorMessage NSLocalizedStringFromTable(@"Invalid application ID selected.", @"WePay", @"Invalid application ID selected.");
263 
267 #define WPDeclinedByCardErrorMessage NSLocalizedStringFromTable(@"The transaction was declined by the card.", @"WePay", @"The transaction was declined by the card.");
268 
272 #define WPCardBlockedErrorMessage NSLocalizedStringFromTable(@"This card has been blocked.", @"WePay", @"This card has been blocked.");
273 
277 #define WPDeclinedByIssuerErrorMessage NSLocalizedStringFromTable(@"The transaction was declined by the issuer bank.", @"WePay", @"The transaction was declined by the issuer bank.");
278 
282 #define WPIssuerUnreachableErrorMessage NSLocalizedStringFromTable(@"The issuing bank could not be reached.", @"WePay", @"The issuing bank could not be reached.");
283 
287 #define WPInvalidAuthInfoErrorMessage NSLocalizedStringFromTable(@"The provided auth info is invalid.", @"WePay", @"The provided auth info is invalid.");
288 
292 #define WPAuthInfoNotProvidedErrorMessage NSLocalizedStringFromTable(@"Auth info was not provided.", @"WePay", @"Auth info was not provided.");
293 
297 #define WPPaymentMethodCannotBeTokenizedErrorMessage NSLocalizedStringFromTable(@"This payment method cannot be tokenized.", @"WePay", @"This payment method cannot be tokenized.");
298 
302 #define WPFailedToGetBatteryLevelErrorMessage NSLocalizedStringFromTable(@"Battery level could not be determined.", @"WePay", @"Battery level could not be determined.");
303 
307 #define WPCardReaderNotConnectedErrorMessage NSLocalizedStringFromTable(@"Card reader is not connected.", @"WePay", @"Card reader is not connected.");
308 
312 #define WPCardReaderModelNotSupportedErrorMessage NSLocalizedStringFromTable(@"This card reader model is not supported.", @"WePay", @"This card reader model is not supported.");
313 
317 #define WPErrorInvalidTransactionAmountErrorMessage NSLocalizedStringFromTable(@"The provided transaction amount is invalid.", @"WePay", @"The provided transaction amount is invalid.");
318 
322 #define WPErrorInvalidTransactionCurrencyCodeErrorMessage NSLocalizedStringFromTable(@"The provided currency code is invalid.", @"WePay", @"The provided currency code is invalid.");
323 
327 #define WPErrorInvalidTransactionAccountIDErrorMessage NSLocalizedStringFromTable(@"The provided account ID is invalid.", @"WePay", @"The provided account ID is invalid.");
328 
332 #define WPErrorInvalidCardReaderSelectionErrorMessage NSLocalizedStringFromTable(@"Card reader selection is invalid.", @"WePay", @"Card reader selection is invalid.");
333 
337 #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.");
338 
342 #define WPErrorCardReaderUnableToConnectErrorMessage NSLocalizedStringFromTable(@"Please make sure you’re using a supported card reader and that it is fully charged.", @"WePay", @"Please make sure you’re using a supported card reader and that it is fully charged.");
Definition: WPError.h:198
Definition: WPError.h:83
FOUNDATION_EXPORT NSString *const kWPErrorCategoryCardSDK
Definition: WPError.h:59
Definition: WPError.h:208
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