Commit c60138e3 by Brent Gulanowski

Invoke completion block on main dispatch queue.

Also improve error description.
parent 93b8a594
...@@ -32,7 +32,7 @@ NSString * const BUYShopifyError = @"BUYShopifyError"; ...@@ -32,7 +32,7 @@ NSString * const BUYShopifyError = @"BUYShopifyError";
- (NSString *)description - (NSString *)description
{ {
return [[self userInfo] description]; return [NSString stringWithFormat:@"Error code %td: %@", self.code, [self userInfo]];
} }
@end @end
...@@ -331,8 +331,10 @@ const NSTimeInterval PollDelay = 0.5; ...@@ -331,8 +331,10 @@ const NSTimeInterval PollDelay = 0.5;
[NSThread sleepForTimeInterval:PollDelay]; [NSThread sleepForTimeInterval:PollDelay];
} }
} }
dispatch_async(dispatch_get_main_queue(), ^{
completion(checkoutStatus == BUYStatusComplete ? PKPaymentAuthorizationStatusSuccess : PKPaymentAuthorizationStatusFailure); completion(checkoutStatus == BUYStatusComplete ? PKPaymentAuthorizationStatusSuccess : PKPaymentAuthorizationStatusFailure);
}); });
});
} }
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment