Commit 0594b7fb by Dima Bart

Revert "Rename method suffix "WithToken" -> "ForToken"."

This reverts commit 4efa5fad.
parent 1d80e96d
......@@ -80,19 +80,19 @@
@"https://_DOMAIN_/api/checkouts.json"
);
XCTAssertEqualObjects(
[self.client urlForCheckoutsForToken:token].absoluteString,
[self.client urlForCheckoutsWithToken:token].absoluteString,
@"https://_DOMAIN_/api/checkouts/_TOKEN_.json"
);
XCTAssertEqualObjects(
[self.client urlForCheckoutsProcessingForToken:token].absoluteString,
[self.client urlForCheckoutsProcessingWithToken:token].absoluteString,
@"https://_DOMAIN_/api/checkouts/_TOKEN_/processing.json"
);
XCTAssertEqualObjects(
[self.client urlForCheckoutsCompletionForToken:token].absoluteString,
[self.client urlForCheckoutsCompletionWithToken:token].absoluteString,
@"https://_DOMAIN_/api/checkouts/_TOKEN_/complete.json"
);
XCTAssertEqualObjects(
[self.client urlForCheckoutsShippingRatesForToken:token parameters:parameters].absoluteString,
[self.client urlForCheckoutsShippingRatesWithToken:token parameters:parameters].absoluteString,
@"https://_DOMAIN_/api/checkouts/_TOKEN_/shipping_rates.json?param=value"
);
......@@ -101,7 +101,7 @@
@"https://_DOMAIN_/api/checkouts/gift_cards.json"
);
XCTAssertEqualObjects(
[self.client urlForCheckoutsUsingGiftCardForToken:token].absoluteString,
[self.client urlForCheckoutsUsingGiftCardWithToken:token].absoluteString,
@"https://_DOMAIN_/api/checkouts/_TOKEN_/gift_cards.json"
);
XCTAssertEqualObjects(
......
......@@ -126,7 +126,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
- (void)testCheckoutPaymentWithOnlyGiftCard
{
BUYOperation *task = [self.client completeCheckoutForToken:@"abcdef" paymentToken:nil completion:^(BUYCheckout *checkout, NSError *error) {}];
BUYOperation *task = [self.client completeCheckoutWithToken:@"abcdef" paymentToken:nil completion:^(BUYCheckout *checkout, NSError *error) {}];
XCTAssertNotNil(task);
}
......
......@@ -154,7 +154,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testCheckoutFlowUsingCreditCard_2" useMocks:[self shouldUseMocks]];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client getShippingRatesForCheckoutForToken:_checkout.token completion:^(NSArray *shippingRates, BUYStatus status, NSError *error) {
[self.client getShippingRatesForCheckoutWithToken:_checkout.token completion:^(NSArray *shippingRates, BUYStatus status, NSError *error) {
XCTAssertNil(error);
XCTAssertEqual(status, BUYStatusComplete);
......@@ -222,26 +222,26 @@
return creditCard;
}
- (void)completeCheckoutForToken:(id<BUYPaymentToken>)paymentToken
- (void)completeCheckoutWithToken:(id<BUYPaymentToken>)paymentToken
{
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
return [self shouldUseMocks];
} withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
NSString *path = request.URL.absoluteString.lastPathComponent;
if ([path isEqualToString:[self.client urlForCheckoutsCompletionForToken:_checkout.token].lastPathComponent]) {
if ([path isEqualToString:[self.client urlForCheckoutsCompletionWithToken:_checkout.token].lastPathComponent]) {
return [OHHTTPStubsResponse responseWithKey:@"testCheckoutFlowUsingCreditCard_5"];
} else if ([path isEqualToString:[self.client urlForCheckoutsProcessingForToken:_checkout.token].lastPathComponent]) {
} else if ([path isEqualToString:[self.client urlForCheckoutsProcessingWithToken:_checkout.token].lastPathComponent]) {
return [OHHTTPStubsResponse responseWithKey:@"testCheckoutFlowUsingCreditCard_14"];
} else if ([path isEqualToString:[self.client urlForCheckoutsForToken:_checkout.token].lastPathComponent]) {
} else if ([path isEqualToString:[self.client urlForCheckoutsWithToken:_checkout.token].lastPathComponent]) {
return [OHHTTPStubsResponse responseWithKey:@"testCheckoutFlowUsingCreditCard_15"];
}
return [OHHTTPStubsResponse responseWithData:[NSData new] statusCode:500 headers:nil];;
}];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client completeCheckoutForToken:_checkout.token paymentToken:paymentToken completion:^(BUYCheckout *returnedCheckout, NSError *error) {
[self.client completeCheckoutWithToken:_checkout.token paymentToken:paymentToken completion:^(BUYCheckout *returnedCheckout, NSError *error) {
XCTAssertNil(error);
XCTAssertNotNil(returnedCheckout);
XCTAssertNotNil(returnedCheckout.order);
......@@ -752,7 +752,7 @@
XCTestExpectation *expectation2 = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client getShippingRatesForCheckoutForToken:_checkout.token completion:^(NSArray *returnedShippingRates, BUYStatus status, NSError *error) {
[self.client getShippingRatesForCheckoutWithToken:_checkout.token completion:^(NSArray *returnedShippingRates, BUYStatus status, NSError *error) {
XCTAssertEqual(BUYStatusPreconditionFailed, status);
[expectation2 fulfill];
}];
......@@ -770,7 +770,7 @@
checkout.token = @"bananaaaa";
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client getShippingRatesForCheckoutForToken:checkout.token completion:^(NSArray *returnedShippingRates, BUYStatus status, NSError *error) {
[self.client getShippingRatesForCheckoutWithToken:checkout.token completion:^(NSArray *returnedShippingRates, BUYStatus status, NSError *error) {
XCTAssertEqual(BUYStatusNotFound, status);
[expectation fulfill];
}];
......@@ -786,7 +786,7 @@
[self fetchShippingRates];
[self updateCheckout];
[self completeCheckoutForToken:[self addCreditCardToCheckout]];
[self completeCheckoutWithToken:[self addCreditCardToCheckout]];
}
- (void)testCheckoutWithAPartialAddress
......@@ -827,7 +827,7 @@
//We use a credit card here because we're not generating apple pay tokens in the tests
id<BUYPaymentToken> token = [self addCreditCardToCheckout];
[self completeCheckoutForToken:token];
[self completeCheckoutWithToken:token];
}
- (void)testCheckoutCreationWithApplicableDiscount
......@@ -933,7 +933,7 @@
[OHHTTPStubs stubUsingResponseWithKey:@"testGetCheckoutWithInvalidToken_0" useMocks:[self shouldUseMocks]];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client getCheckoutForToken:@"zzzzzzzzzzz" completion:^(BUYCheckout *checkout, NSError *error) {
[self.client getCheckoutWithToken:@"zzzzzzzzzzz" completion:^(BUYCheckout *checkout, NSError *error) {
XCTAssertEqual(404, error.code);
[expectation fulfill];
......@@ -1021,7 +1021,7 @@
// Expire the checkout
XCTestExpectation *expectation2 = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client removeProductReservationsFromCheckoutForToken:_checkout.token completion:^(BUYCheckout *returnedCheckout, NSError *error) {
[self.client removeProductReservationsFromCheckoutWithToken:_checkout.token completion:^(BUYCheckout *returnedCheckout, NSError *error) {
XCTAssertNil(error);
......
......@@ -116,7 +116,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
*
* @return The associated BUYRequestOperation
*/
- (BUYRequestOperation *)getCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block;
- (BUYRequestOperation *)getCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block;
/**
* Finalizes the BUYCheckout associated with the token and charges the payment provider (ex: Credit Card, Apple Pay, etc).
......@@ -132,7 +132,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
*
* @return The associated BUYOperation
*/
- (BUYOperation *)completeCheckoutForToken:(nullable NSString *)checkoutToken paymentToken:(_Nullable id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block;
- (BUYOperation *)completeCheckoutWithToken:(nullable NSString *)checkoutToken paymentToken:(_Nullable id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block;
/**
* Retrieve the status of a checkout with token. This checks the status of the current payment processing job for the provided checkout.
......@@ -143,7 +143,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
*
* @return The associated BUYRequestOperation
*/
- (BUYRequestOperation *)getCompletionStatusOfCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataStatusBlock)block;
- (BUYRequestOperation *)getCompletionStatusOfCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataStatusBlock)block;
/**
* Retrieve the status of a checkout given a URL obtained in the UIApplicationDelegate method `application:sourceApplication:annotation`
......@@ -166,7 +166,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
*
* @return The associated BUYRequestOperation
*/
- (BUYRequestOperation *)getShippingRatesForCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataShippingRatesBlock)block;
- (BUYRequestOperation *)getShippingRatesForCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataShippingRatesBlock)block;
#pragma mark - Cards -
......@@ -222,7 +222,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
*
* @return The associated BUYRequestOperation
*/
- (BUYRequestOperation *)removeProductReservationsFromCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block;
- (BUYRequestOperation *)removeProductReservationsFromCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block;
@end
......
......@@ -71,38 +71,38 @@
{
BUYAssertCheckout(checkout);
NSURL *route = [self urlForCheckoutsForToken:checkout.token];
NSURL *route = [self urlForCheckoutsWithToken:checkout.token];
return [self patchRequestForURL:route object:checkout completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
[self handleCheckoutResponse:json error:error block:block];
}];
}
- (BUYRequestOperation *)getCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block
- (BUYRequestOperation *)getCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block
{
return [self getCheckoutForToken:checkoutToken start:YES completion:block];
return [self getCheckoutWithToken:checkoutToken start:YES completion:block];
}
- (BUYRequestOperation *)getCheckoutForToken:(NSString *)checkoutToken start:(BOOL)start completion:(BUYDataCheckoutBlock)block
- (BUYRequestOperation *)getCheckoutWithToken:(NSString *)checkoutToken start:(BOOL)start completion:(BUYDataCheckoutBlock)block
{
BUYAssertToken(checkoutToken);
NSURL *url = [self urlForCheckoutsForToken:checkoutToken];
NSURL *url = [self urlForCheckoutsWithToken:checkoutToken];
return [self getRequestForURL:url start:start completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
[self handleCheckoutResponse:json error:error block:block];
}];
}
- (BUYOperation *)completeCheckoutForToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block
- (BUYOperation *)completeCheckoutWithToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block
{
BUYCheckoutOperation *operation = [[BUYCheckoutOperation alloc] initWithClient:self checkoutToken:checkoutToken token:paymentToken completion:block];
[self startOperation:operation];
return operation;
}
- (BUYRequestOperation *)getCompletionStatusOfCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataStatusBlock)block
- (BUYRequestOperation *)getCompletionStatusOfCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataStatusBlock)block
{
BUYAssertToken(checkoutToken);
return [self getCompletionStatusOfCheckoutForToken:checkoutToken start:YES completion:block];
return [self getCompletionStatusOfCheckoutWithToken:checkoutToken start:YES completion:block];
}
- (BUYRequestOperation *)getCompletionStatusOfCheckoutURL:(NSURL *)url completion:(BUYDataStatusBlock)block
......@@ -119,24 +119,24 @@
BUYAssert(token, @"Failed to get completion status of checkout. Checkout URL must have a valid token associated with it.");
return [self getCompletionStatusOfCheckoutForToken:token start:YES completion:block];
return [self getCompletionStatusOfCheckoutWithToken:token start:YES completion:block];
}
#pragma mark - Checkout Helpers -
- (BUYRequestOperation *)beginCheckoutForToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block
- (BUYRequestOperation *)beginCheckoutWithToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block
{
BUYAssertToken(checkoutToken);
NSURL *route = [self urlForCheckoutsCompletionForToken:checkoutToken];
NSURL *route = [self urlForCheckoutsCompletionWithToken:checkoutToken];
return [self postRequestForURL:route object:[paymentToken JSONDictionary] start:NO completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
[self handleCheckoutResponse:json error:error block:block];
}];
}
- (BUYRequestOperation *)getCompletionStatusOfCheckoutForToken:(NSString *)token start:(BOOL)start completion:(BUYDataStatusBlock)block
- (BUYRequestOperation *)getCompletionStatusOfCheckoutWithToken:(NSString *)token start:(BOOL)start completion:(BUYDataStatusBlock)block
{
NSURL *url = [self urlForCheckoutsProcessingForToken:token];
NSURL *url = [self urlForCheckoutsProcessingWithToken:token];
return [self getRequestForURL:url start:start completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
block([self statusForStatusCode:response.statusCode error:error], error);
}];
......@@ -170,11 +170,11 @@
#pragma mark - Shipping Rates -
- (BUYRequestOperation *)getShippingRatesForCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataShippingRatesBlock)block
- (BUYRequestOperation *)getShippingRatesForCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataShippingRatesBlock)block
{
BUYAssertToken(checkoutToken);
NSURL *url = [self urlForCheckoutsShippingRatesForToken:checkoutToken parameters:@{
NSURL *url = [self urlForCheckoutsShippingRatesWithToken:checkoutToken parameters:@{
@"checkout" : @"",
}];
......@@ -224,7 +224,7 @@
BUYAssert(giftCardCode.length > 0, @"Failed to apply gift card code. Invalid gift card code.");
BUYGiftCard *giftCard = [self.modelManager giftCardWithCode:giftCardCode];
NSURL *route = [self urlForCheckoutsUsingGiftCardForToken:checkout.token];
NSURL *route = [self urlForCheckoutsUsingGiftCardWithToken:checkout.token];
return [self postRequestForURL:route object:giftCard completionHandler:^(NSDictionary *json, NSHTTPURLResponse *response, NSError *error) {
if (json && !error) {
......@@ -272,7 +272,7 @@
#pragma mark - Reservations -
- (BUYRequestOperation *)removeProductReservationsFromCheckoutForToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block
- (BUYRequestOperation *)removeProductReservationsFromCheckoutWithToken:(NSString *)checkoutToken completion:(BUYDataCheckoutBlock)block
{
BUYAssertToken(checkoutToken);
......
......@@ -62,8 +62,8 @@ typedef void (^BUYClientRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResp
@interface BUYClient (PrivateCheckout)
- (BUYRequestOperation *)beginCheckoutForToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block;
- (BUYRequestOperation *)getCompletionStatusOfCheckoutForToken:(NSString *)token start:(BOOL)start completion:(BUYDataStatusBlock)block;
- (BUYRequestOperation *)getCheckoutForToken:(NSString *)checkoutToken start:(BOOL)start completion:(BUYDataCheckoutBlock)block;
- (BUYRequestOperation *)beginCheckoutWithToken:(NSString *)checkoutToken paymentToken:(id<BUYPaymentToken>)paymentToken completion:(BUYDataCheckoutBlock)block;
- (BUYRequestOperation *)getCompletionStatusOfCheckoutWithToken:(NSString *)token start:(BOOL)start completion:(BUYDataStatusBlock)block;
- (BUYRequestOperation *)getCheckoutWithToken:(NSString *)checkoutToken start:(BOOL)start completion:(BUYDataCheckoutBlock)block;
@end
......@@ -36,13 +36,13 @@
- (NSURL *)urlForCollectionListingsWithParameters:(NSDictionary *)parameters;
- (NSURL *)urlForCheckouts;
- (NSURL *)urlForCheckoutsForToken:(NSString *)token;
- (NSURL *)urlForCheckoutsProcessingForToken:(NSString *)token;
- (NSURL *)urlForCheckoutsCompletionForToken:(NSString *)token;
- (NSURL *)urlForCheckoutsShippingRatesForToken:(NSString *)token parameters:(NSDictionary *)parameters;
- (NSURL *)urlForCheckoutsWithToken:(NSString *)token;
- (NSURL *)urlForCheckoutsProcessingWithToken:(NSString *)token;
- (NSURL *)urlForCheckoutsCompletionWithToken:(NSString *)token;
- (NSURL *)urlForCheckoutsShippingRatesWithToken:(NSString *)token parameters:(NSDictionary *)parameters;
- (NSURL *)urlForCheckoutsUsingGiftCard;
- (NSURL *)urlForCheckoutsUsingGiftCardForToken:(NSString *)token;
- (NSURL *)urlForCheckoutsUsingGiftCardWithToken:(NSString *)token;
- (NSURL *)urlForCheckoutsUsingGiftCard:(NSNumber *)giftCardID token:(NSString *)token;
- (NSURL *)urlForCustomers;
......
......@@ -131,24 +131,24 @@
return [[[self urlForAPI] appendPath:@"/checkouts"] appendExtension];
}
- (NSURL *)urlForCheckoutsForToken:(NSString *)token
- (NSURL *)urlForCheckoutsWithToken:(NSString *)token
{
return [self _urlForCheckoutsAction:@"" forToken:token];
return [self _urlForCheckoutsAction:@"" withToken:token];
}
- (NSURL *)urlForCheckoutsProcessingForToken:(NSString *)token
- (NSURL *)urlForCheckoutsProcessingWithToken:(NSString *)token
{
return [self _urlForCheckoutsAction:@"/processing" forToken:token];
return [self _urlForCheckoutsAction:@"/processing" withToken:token];
}
- (NSURL *)urlForCheckoutsCompletionForToken:(NSString *)token
- (NSURL *)urlForCheckoutsCompletionWithToken:(NSString *)token
{
return [self _urlForCheckoutsAction:@"/complete" forToken:token];
return [self _urlForCheckoutsAction:@"/complete" withToken:token];
}
- (NSURL *)urlForCheckoutsShippingRatesForToken:(NSString *)token parameters:(NSDictionary *)parameters
- (NSURL *)urlForCheckoutsShippingRatesWithToken:(NSString *)token parameters:(NSDictionary *)parameters
{
return [[self _urlForCheckoutsAction:@"/shipping_rates" forToken:token] appendParameters:parameters];
return [[self _urlForCheckoutsAction:@"/shipping_rates" withToken:token] appendParameters:parameters];
}
- (NSURL *)urlForCheckoutsUsingGiftCard
......@@ -156,14 +156,14 @@
return [[[self urlForCheckouts] appendPath:@"/gift_cards"] appendExtension];
}
- (NSURL *)urlForCheckoutsUsingGiftCardForToken:(NSString *)token
- (NSURL *)urlForCheckoutsUsingGiftCardWithToken:(NSString *)token
{
return [[[[self urlForCheckouts] appendPath:token] appendPath:@"/gift_cards"] appendExtension];
}
- (NSURL *)urlForCheckoutsUsingGiftCard:(NSNumber *)giftCardID token:(NSString *)token
{
return [[[self urlForCheckoutsUsingGiftCardForToken:token] appendIdentifier:giftCardID] appendExtension];
return [[[self urlForCheckoutsUsingGiftCardWithToken:token] appendIdentifier:giftCardID] appendExtension];
}
#pragma mark - Customers -
......@@ -229,7 +229,7 @@
#pragma mark - Utilities -
- (NSURL *)_urlForCheckoutsAction:(NSString *)action forToken:(NSString *)token
- (NSURL *)_urlForCheckoutsAction:(NSString *)action withToken:(NSString *)token
{
return [[[[self urlForCheckouts] appendPath:token] appendPath:action] appendExtension];
}
......
......@@ -137,7 +137,7 @@
- (BUYRequestOperation *)createBeginOperation
{
return [self.client beginCheckoutForToken:self.checkoutToken paymentToken:self.token completion:^(BUYCheckout *checkout, NSError *error) {
return [self.client beginCheckoutWithToken:self.checkoutToken paymentToken:self.token completion:^(BUYCheckout *checkout, NSError *error) {
if (!checkout) {
[self finishWithError:error];
}
......@@ -146,7 +146,7 @@
- (BUYRequestOperation *)createPollOperation
{
BUYRequestOperation *operation =[self.client getCompletionStatusOfCheckoutForToken:self.checkoutToken start:NO completion:^(BUYStatus status, NSError *error) {
BUYRequestOperation *operation =[self.client getCompletionStatusOfCheckoutWithToken:self.checkoutToken start:NO completion:^(BUYStatus status, NSError *error) {
if (status != BUYStatusComplete) {
[self finishWithError:error];
}
......@@ -160,7 +160,7 @@
- (BUYRequestOperation *)createGetOperation
{
return [self.client getCheckoutForToken:self.checkoutToken start:NO completion:^(BUYCheckout *checkout, NSError *error) {
return [self.client getCheckoutWithToken:self.checkoutToken start:NO completion:^(BUYCheckout *checkout, NSError *error) {
if (checkout) {
[self finishWithCheckout:checkout];
} else {
......
......@@ -99,7 +99,7 @@ const NSTimeInterval PollDelay = 0.5;
id<BUYPaymentToken> token = [[BUYApplePayToken alloc] initWithPaymentToken:payment.token];
//Now that the checkout is up to date, call complete.
[self.client completeCheckoutForToken:checkout.token paymentToken:token completion:^(BUYCheckout *checkout, NSError *error) {
[self.client completeCheckoutWithToken:checkout.token paymentToken:token completion:^(BUYCheckout *checkout, NSError *error) {
if (checkout && error == nil) {
self.checkout = checkout;
......@@ -242,7 +242,7 @@ const NSTimeInterval PollDelay = 0.5;
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block BUYStatus shippingStatus = BUYStatusUnknown;
do {
[self.client getShippingRatesForCheckoutForToken:self.checkout.token completion:^(NSArray *shippingRates, BUYStatus status, NSError *error) {
[self.client getShippingRatesForCheckoutWithToken:self.checkout.token completion:^(NSArray *shippingRates, BUYStatus status, NSError *error) {
shippingStatus = status;
if (error) {
......@@ -295,7 +295,7 @@ const NSTimeInterval PollDelay = 0.5;
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
while (checkout.token && checkoutStatus != BUYStatusFailed && checkoutStatus != BUYStatusComplete) {
[self.client getCompletionStatusOfCheckoutForToken:self.checkout.token completion:^(BUYStatus status, NSError *error) {
[self.client getCompletionStatusOfCheckoutWithToken:self.checkout.token completion:^(BUYStatus status, NSError *error) {
checkoutStatus = status;
self.lastError = error;
dispatch_semaphore_signal(semaphore);
......
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