Commit 4e176302 by Rune Madsen

Fix shipping rate issue for Apple Pay

parent d33f318e
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
- (instancetype)initWithCart:(BUYCart *)cart - (instancetype)initWithCart:(BUYCart *)cart
{ {
self = [super initWithDictionary:@{}]; self = [super init];
if (self) { if (self) {
_lineItems = [cart.lineItems copy]; _lineItems = [cart.lineItems copy];
[self markPropertyAsDirty:@"lineItems"]; [self markPropertyAsDirty:@"lineItems"];
......
...@@ -57,5 +57,4 @@ NSString * const BUYPartialAddressPlaceholder = @"---"; ...@@ -57,5 +57,4 @@ NSString * const BUYPartialAddressPlaceholder = @"---";
return valid; return valid;
} }
@end @end
...@@ -264,8 +264,7 @@ const NSTimeInterval PollDelay = 0.5; ...@@ -264,8 +264,7 @@ const NSTimeInterval PollDelay = 0.5;
self.shippingRates = shippingRates; self.shippingRates = shippingRates;
if ([self.shippingRates count] == 0) { if ([self.shippingRates count] == 0) {
// Shipping address not supported // Shipping address is not supported and no shipping rates were returned
self.checkout.shippingRate = nil;
if (completion) { if (completion) {
completion(PKPaymentAuthorizationStatusInvalidShippingPostalAddress, nil, [self.checkout buy_summaryItemsWithShopName:self.shop.name]); completion(PKPaymentAuthorizationStatusInvalidShippingPostalAddress, nil, [self.checkout buy_summaryItemsWithShopName:self.shop.name]);
} }
......
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