Commit b7248c54 by David Muzi

Merge pull request #103 from Shopify/public/apple-pay-shop-fix

Public/apple pay shop fix
parents 78acdd90 dd89e6fd
...@@ -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
...@@ -147,7 +147,7 @@ NSString * BUYURLKey = @"url"; ...@@ -147,7 +147,7 @@ NSString * BUYURLKey = @"url";
__block NSError *checkoutError = nil; __block NSError *checkoutError = nil;
// download the shop // download the shop
if (self.shop != nil) { if (self.shop == nil) {
dispatch_group_enter(group); dispatch_group_enter(group);
[self loadShopWithCallback:^(BOOL success, NSError *error) { [self loadShopWithCallback:^(BOOL success, NSError *error) {
......
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