Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
64dacde6
Commit
64dacde6
authored
May 20, 2016
by
Gabriel O'Flaherty-Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update class header and remove readwrite property redeclerations
parent
8f04c819
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
BUYApplePayAuthorizationDelegate.h
...K/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.h
+2
-2
BUYApplePayAuthorizationDelegate.m
...K/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
+13
-15
No files found.
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.h
View file @
64dacde6
...
...
@@ -63,9 +63,9 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
strong
,
readonly
)
NSError
*
lastError
;
/**
* The shop
object
* The shop
name
*/
@property
(
nonatomic
,
strong
,
readonly
)
BUYShop
*
shop
;
@property
(
nonatomic
,
strong
,
readonly
)
NSString
*
shopName
;
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
View file @
64dacde6
...
...
@@ -38,14 +38,12 @@
const
NSTimeInterval
PollDelay
=
0
.
5
;
@interface
BUYApplePayAuthorizationDelegate
()
@property
(
nonatomic
,
strong
)
BUYCheckout
*
checkout
;
@property
(
nonatomic
,
strong
)
BUYClient
*
client
;
@property
(
nonatomic
,
strong
)
NSArray
*
shippingRates
;
@property
(
nonatomic
,
strong
)
NSError
*
lastError
;
@property
(
nonatomic
,
strong
)
NSString
*
shopName
;
@end
@implementation
BUYApplePayAuthorizationDelegate
...
...
@@ -58,9 +56,9 @@ const NSTimeInterval PollDelay = 0.5;
self
=
[
super
init
];
if
(
self
)
{
self
.
client
=
client
;
self
.
checkout
=
checkout
;
self
.
shopName
=
shopName
;
_
client
=
client
;
_
checkout
=
checkout
;
_
shopName
=
shopName
;
}
return
self
;
...
...
@@ -157,7 +155,7 @@ const NSTimeInterval PollDelay = 0.5;
else
{
self
.
lastError
=
error
;
}
completion
(
error
==
nil
?
PKPaymentAuthorizationStatusSuccess
:
PKPaymentAuthorizationStatusFailure
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
error
==
nil
?
PKPaymentAuthorizationStatusSuccess
:
PKPaymentAuthorizationStatusFailure
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}];
}
...
...
@@ -181,12 +179,12 @@ const NSTimeInterval PollDelay = 0.5;
}
else
{
self
.
lastError
=
error
;
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
}];
}
else
{
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
}
...
...
@@ -211,7 +209,7 @@ const NSTimeInterval PollDelay = 0.5;
// We then turn our BUYShippingRate objects into PKShippingMethods for Apple to present to the user.
if
([
self
.
checkout
requiresShipping
]
==
NO
)
{
completion
(
PKPaymentAuthorizationStatusSuccess
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusSuccess
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
else
{
[
self
fetchShippingRates
:
^
(
PKPaymentAuthorizationStatus
status
,
NSArray
*
methods
,
NSArray
*
summaryItems
)
{
...
...
@@ -222,12 +220,12 @@ const NSTimeInterval PollDelay = 0.5;
if
(
checkout
&&
error
==
nil
)
{
self
.
checkout
=
checkout
;
}
completion
(
error
?
PKPaymentAuthorizationStatusFailure
:
PKPaymentAuthorizationStatusSuccess
,
shippingMethods
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
error
?
PKPaymentAuthorizationStatusFailure
:
PKPaymentAuthorizationStatusSuccess
,
shippingMethods
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}];
}
else
{
self
.
lastError
=
[
NSError
errorWithDomain
:
BUYShopifyError
code
:
BUYShopifyError_NoShippingMethodsToAddress
userInfo
:
nil
];
completion
(
status
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
status
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
}];
}
...
...
@@ -246,7 +244,7 @@ const NSTimeInterval PollDelay = 0.5;
shippingStatus
=
status
;
if
(
error
)
{
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
else
if
(
shippingStatus
==
BUYStatusComplete
)
{
self
.
shippingRates
=
shippingRates
;
...
...
@@ -254,11 +252,11 @@ const NSTimeInterval PollDelay = 0.5;
if
([
self
.
shippingRates
count
]
==
0
)
{
// Shipping address is not supported and no shipping rates were returned
if
(
completion
)
{
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
}
else
{
if
(
completion
)
{
completion
(
PKPaymentAuthorizationStatusSuccess
,
self
.
shippingRates
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
.
n
ame
]);
completion
(
PKPaymentAuthorizationStatusSuccess
,
self
.
shippingRates
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shop
N
ame
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment