Permalink
Browse files

Use constant rather than magic number for failed auth error code

  • Loading branch information...
1 parent c6d77c9 commit 58cffb05e35696d73b013b1fbeee341319a3a76f Brian Collins committed Oct 17, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Stripe.m
View
@@ -82,7 +82,8 @@ - (void)performRequestWithCard:(StripeCard *)card amountInCents:(NSNumber *)amou
completionHandler:^(NSURLResponse *response, NSData *body, NSError *requestError)
{
if (!response && requestError) {
- if ([requestError.domain isEqualToString:@"NSURLErrorDomain"] && requestError.code == -1012) {
+ if ([requestError.domain isEqualToString:@"NSURLErrorDomain"] &&
+ requestError.code == NSURLErrorUserCancelledAuthentication) {
error([NSError errorWithDomain:@"Stripe" code:0 userInfo:
[NSDictionary dictionaryWithObject:@"Authentication failed" forKey:@"message"]]);
} else

0 comments on commit 58cffb0

Please sign in to comment.