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
fd81b6e6
Commit
fd81b6e6
authored
Jun 13, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a typedef for block type to improve code readability.
parent
eb7cd466
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
BUYApplePayAuthorizationDelegate.m
...K/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
+6
-6
No files found.
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
View file @
fd81b6e6
...
...
@@ -38,7 +38,7 @@
const
NSTimeInterval
PollDelay
=
0
.
5
;
typedef
void
(
^
AddressUpdateCompletion
)(
PKPaymentAuthorizationStatus
,
NSArray
*
shippingMethods
,
NSArray
*
summaryItems
);
typedef
void
(
^
AddressUpdateCompletion
)(
PKPaymentAuthorizationStatus
,
NSArray
<
PKShippingMethod
*>
*
_Nonnull
,
NSArray
<
PKPaymentSummaryItem
*>
*
_Nonnull
);
@interface
BUYApplePayAuthorizationDelegate
()
...
...
@@ -132,13 +132,13 @@ typedef void (^AddressUpdateCompletion)(PKPaymentAuthorizationStatus, NSArray *s
[
controller
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
-
(
void
)
paymentAuthorizationViewController
:(
PKPaymentAuthorizationViewController
*
)
controller
didSelectShippingAddress
:(
ABRecordRef
)
address
completion
:(
void
(
^
)(
PKPaymentAuthorizationStatus
,
NSArray
<
PKShippingMethod
*>
*
_Nonnull
,
NSArray
<
PKPaymentSummaryItem
*>
*
_Nonnull
)
)
completion
-
(
void
)
paymentAuthorizationViewController
:(
PKPaymentAuthorizationViewController
*
)
controller
didSelectShippingAddress
:(
ABRecordRef
)
address
completion
:(
AddressUpdateCompletion
)
completion
{
self
.
checkout
.
shippingAddress
=
[
self
buyAddressWithABRecord
:
address
];
[
self
updateCheckoutWithAddressCompletion
:
completion
];
}
-
(
void
)
paymentAuthorizationViewController
:(
PKPaymentAuthorizationViewController
*
)
controller
didSelectShippingContact
:(
PKContact
*
)
contact
completion
:(
void
(
^
)(
PKPaymentAuthorizationStatus
,
NSArray
<
PKShippingMethod
*>
*
_Nonnull
,
NSArray
<
PKPaymentSummaryItem
*>
*
_Nonnull
)
)
completion
-
(
void
)
paymentAuthorizationViewController
:(
PKPaymentAuthorizationViewController
*
)
controller
didSelectShippingContact
:(
PKContact
*
)
contact
completion
:(
AddressUpdateCompletion
)
completion
{
self
.
checkout
.
shippingAddress
=
[
self
buyAddressWithContact
:
contact
];
[
self
updateCheckoutWithAddressCompletion
:
completion
];
...
...
@@ -184,12 +184,12 @@ typedef void (^AddressUpdateCompletion)(PKPaymentAuthorizationStatus, NSArray *s
[
self
updateShippingRatesCompletion
:
completion
];
}
else
{
completion
(
PKPaymentAuthorizationStatusSuccess
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
completion
(
PKPaymentAuthorizationStatusSuccess
,
@[]
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
}
}];
}
else
{
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
@[]
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
}
}
...
...
@@ -211,7 +211,7 @@ typedef void (^AddressUpdateCompletion)(PKPaymentAuthorizationStatus, NSArray *s
}
else
{
self
.
lastError
=
[
NSError
errorWithDomain
:
BUYShopifyError
code
:
BUYShopifyError_NoShippingMethodsToAddress
userInfo
:
nil
];
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
nil
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
completion
(
PKPaymentAuthorizationStatusInvalidShippingPostalAddress
,
@[]
,
[
self
.
checkout
buy_summaryItemsWithShopName
:
self
.
shopName
]);
}
}];
}
...
...
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