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";
- (NSString *)description
{
return [[self userInfo] description];
return [NSString stringWithFormat:@"Error code %td: %@", self.code, [self userInfo]];
}
@end
......@@ -331,7 +331,9 @@ const NSTimeInterval PollDelay = 0.5;
[NSThread sleepForTimeInterval:PollDelay];
}
}
completion(checkoutStatus == BUYStatusComplete ? PKPaymentAuthorizationStatusSuccess : PKPaymentAuthorizationStatusFailure);
dispatch_async(dispatch_get_main_queue(), ^{
completion(checkoutStatus == BUYStatusComplete ? PKPaymentAuthorizationStatusSuccess : PKPaymentAuthorizationStatusFailure);
});
});
}
......
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