Commit 404803d8 by Brent Gulanowski

Throw exception when asked to start a checkout that was already started.

parent c9b3e283
...@@ -81,13 +81,12 @@ static NSString *const WebCheckoutCustomerAccessToken = @"customer_access_token" ...@@ -81,13 +81,12 @@ static NSString *const WebCheckoutCustomerAccessToken = @"customer_access_token"
- (void)startCheckout:(BUYCheckout *)checkout - (void)startCheckout:(BUYCheckout *)checkout
{ {
if (self.isInProgress) { if (self.isInProgress) {
return; [[NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"Asked to start checkout; but checkout has already started in %@", self] userInfo:nil] raise];
} }
self.checkout = checkout; self.checkout = checkout;
[self.client handleCheckout:checkout completion:^(BUYCheckout *checkout, NSError *error) { [self.client handleCheckout:checkout completion:^(BUYCheckout *checkout, NSError *error) {
[self postCheckoutCompletion:checkout error:error]; [self postCheckoutCompletion:checkout error: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