add category prefix to stripeerror
This commit is contained in:
parent
858a9e25cc
commit
39e0759842
|
@ -66,6 +66,6 @@ FOUNDATION_EXPORT NSString * __nonnull const STPIncorrectCVC;
|
|||
|
||||
@interface NSError(Stripe)
|
||||
|
||||
+ (nullable NSError *)errorFromStripeResponse:(nullable NSDictionary *)jsonDictionary;
|
||||
+ (nullable NSError *)stp_errorFromStripeResponse:(nullable NSDictionary *)jsonDictionary;
|
||||
|
||||
@end
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
[[apiClient.urlSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable body, __unused NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||
NSDictionary *jsonDictionary = body ? [NSJSONSerialization JSONObjectWithData:body options:0 error:NULL] : nil;
|
||||
id<STPAPIResponseDecodable> responseObject = [[serializer class] decodedObjectFromAPIResponse:jsonDictionary];
|
||||
NSError *returnedError = [NSError errorFromStripeResponse:jsonDictionary] ?: error;
|
||||
NSError *returnedError = [NSError stp_errorFromStripeResponse:jsonDictionary] ?: error;
|
||||
if (!responseObject && !returnedError) {
|
||||
NSDictionary *userInfo = @{
|
||||
NSLocalizedDescriptionKey: STPUnexpectedError,
|
||||
|
|
|
@ -25,7 +25,7 @@ NSString *const STPIncorrectCVC = @"com.stripe.lib:IncorrectCVC";
|
|||
|
||||
@implementation NSError(Stripe)
|
||||
|
||||
+ (NSError *)errorFromStripeResponse:(NSDictionary *)jsonDictionary {
|
||||
+ (NSError *)stp_errorFromStripeResponse:(NSDictionary *)jsonDictionary {
|
||||
NSDictionary *errorDictionary = jsonDictionary[@"error"];
|
||||
if (!errorDictionary) {
|
||||
return nil;
|
||||
|
|
Loading…
Reference in New Issue