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
6940a665
Commit
6940a665
authored
9 years ago
by
Rune Madsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressing comments
parent
d90063d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
CheckoutViewController.m
...d/Mobile Buy SDK Advanced Sample/CheckoutViewController.m
+18
-17
No files found.
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/CheckoutViewController.m
View file @
6940a665
...
...
@@ -196,11 +196,11 @@ NSString * const MerchantId = @"";
-
(
void
)
safariViewControllerDidFinish
:
(
SFSafariViewController
*
)
controller
{
[
self
getCompletedCheckout
:
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
.
checkout
.
order
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
showCheckoutConfirmation
];
}
});
}
}];
}
...
...
@@ -314,9 +314,7 @@ NSString * const MerchantId = @"";
[
self
.
applePayHelper
paymentAuthorizationViewController
:
controller
didAuthorizePayment
:
payment
completion
:
completion
];
self
.
checkout
=
self
.
applePayHelper
.
checkout
;
[
self
getCompletedCheckout
:
^
{
}];
[
self
getCompletedCheckout
:
NULL
];
}
-
(
void
)
paymentAuthorizationViewControllerDidFinish
:
(
PKPaymentAuthorizationViewController
*
)
controller
...
...
@@ -366,9 +364,23 @@ NSString * const MerchantId = @"";
{
NSURL
*
url
=
notification
.
userInfo
[
@"url"
];
if
([
self
.
presentedViewController
isKindOfClass
:[
SFSafariViewController
class
]])
{
[
self
dismissViewControllerAnimated
:
self
.
presentedViewController
completion
:
^
{
[
self
getCompletionStatusAndCompletedCheckoutWithURL
:
url
];
}];
}
else
{
[
self
getCompletionStatusAndCompletedCheckoutWithURL
:
url
];
}
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
CheckoutCallbackNotification
object
:
nil
];
}
-
(
void
)
getCompletionStatusAndCompletedCheckoutWithURL
:
(
NSURL
*
)
url
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
__weak
CheckoutViewController
*
welf
=
self
;
void
(
^
completionBlock
)()
=
^
void
()
{
[
self
.
client
getCompletionStatusOfCheckoutURL
:
url
completion
:
^
(
BUYStatus
status
,
NSError
*
error
)
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
...
...
@@ -385,17 +397,6 @@ NSString * const MerchantId = @"";
NSLog
(
@"Error completing checkout: %@"
,
error
);
}
}];
};
if
([
self
.
presentedViewController
isKindOfClass
:[
SFSafariViewController
class
]])
{
[
self
dismissViewControllerAnimated
:
self
.
presentedViewController
completion
:
completionBlock
];
}
else
{
completionBlock
();
}
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
CheckoutCallbackNotification
object
:
nil
];
}
-
(
void
)
getCompletedCheckout
:
(
void
(
^
)(
void
))
completionBlock
...
...
This diff is collapsed.
Click to expand it.
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