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
3fe05c4f
Commit
3fe05c4f
authored
May 31, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert getCompletionStatus to use token.
parent
28bce436
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
12 deletions
+11
-12
BUYClient+Checkout.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.h
+3
-3
BUYClient+Checkout.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.m
+5
-6
BUYClient+Internal.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Internal.h
+1
-1
BUYCheckoutOperation.m
... Buy SDK/Mobile Buy SDK/Operations/BUYCheckoutOperation.m
+1
-1
BUYApplePayAuthorizationDelegate.m
...K/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
+1
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.h
View file @
3fe05c4f
...
@@ -138,15 +138,15 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
...
@@ -138,15 +138,15 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
-
(
BUYOperation
*
)
completeCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
_Nullable
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
-
(
BUYOperation
*
)
completeCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
_Nullable
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
/**
/**
* Retrieve the status of a
BUYCheckout
. This checks the status of the current payment processing job for the provided checkout.
* Retrieve the status of a
checkout with token
. This checks the status of the current payment processing job for the provided checkout.
* Once the job is complete (status == BUYStatusComplete), you can retrieve the completed order by calling `getCheckout:completion`
* Once the job is complete (status == BUYStatusComplete), you can retrieve the completed order by calling `getCheckout:completion`
*
*
* @param checkout
The BUYCheckout to retrieve completion status for
* @param checkout
Token The checkout token for which to retrieve completion status
* @param block (^BUYDataStatusBlock)(BUYCheckout *checkout, BUYStatus status, NSError *error);
* @param block (^BUYDataStatusBlock)(BUYCheckout *checkout, BUYStatus status, NSError *error);
*
*
* @return The associated BUYRequestOperation
* @return The associated BUYRequestOperation
*/
*/
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
:(
BUYCheckout
*
)
checkout
completion
:(
BUYDataStatusBlock
)
block
;
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
WithToken
:(
NSString
*
)
checkoutToken
completion
:(
BUYDataStatusBlock
)
block
;
/**
/**
* Retrieve the status of a checkout given a URL obtained in the UIApplicationDelegate method `application:sourceApplication:annotation`
* Retrieve the status of a checkout given a URL obtained in the UIApplicationDelegate method `application:sourceApplication:annotation`
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.m
View file @
3fe05c4f
...
@@ -98,11 +98,10 @@
...
@@ -98,11 +98,10 @@
return
operation
;
return
operation
;
}
}
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
:(
BUYCheckout
*
)
checkout
completion
:(
BUYDataStatusBlock
)
block
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
WithToken
:(
NSString
*
)
checkoutToken
completion
:(
BUYDataStatusBlock
)
block
{
{
BUYAssertCheckout
(
checkout
);
BUYAssertToken
(
checkoutToken
);
return
[
self
getCompletionStatusOfCheckoutWithToken
:
checkoutToken
start
:
YES
completion
:
block
];
return
[
self
getCompletionStatusOfCheckoutToken
:
checkout
.
token
start
:
YES
completion
:
block
];
}
}
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckoutURL
:(
NSURL
*
)
url
completion
:(
BUYDataStatusBlock
)
block
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckoutURL
:(
NSURL
*
)
url
completion
:(
BUYDataStatusBlock
)
block
...
@@ -119,7 +118,7 @@
...
@@ -119,7 +118,7 @@
BUYAssert
(
token
,
@"Failed to get completion status of checkout. Checkout URL must have a valid token associated with it."
);
BUYAssert
(
token
,
@"Failed to get completion status of checkout. Checkout URL must have a valid token associated with it."
);
return
[
self
getCompletionStatusOfCheckoutToken
:
token
start
:
YES
completion
:
block
];
return
[
self
getCompletionStatusOfCheckout
With
Token
:
token
start
:
YES
completion
:
block
];
}
}
#pragma mark - Checkout Helpers -
#pragma mark - Checkout Helpers -
...
@@ -138,7 +137,7 @@
...
@@ -138,7 +137,7 @@
}];
}];
}
}
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckoutToken
:(
NSString
*
)
token
start
:(
BOOL
)
start
completion
:(
BUYDataStatusBlock
)
block
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
With
Token
:(
NSString
*
)
token
start
:(
BOOL
)
start
completion
:(
BUYDataStatusBlock
)
block
{
{
NSURL
*
url
=
[
self
urlForCheckoutsProcessingWithToken
:
token
];
NSURL
*
url
=
[
self
urlForCheckoutsProcessingWithToken
:
token
];
return
[
self
getRequestForURL
:
url
start
:
start
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
getRequestForURL
:
url
start
:
start
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Internal.h
View file @
3fe05c4f
...
@@ -63,7 +63,7 @@ typedef void (^BUYClientRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResp
...
@@ -63,7 +63,7 @@ typedef void (^BUYClientRequestJSONCompletion)(NSDictionary *json, NSHTTPURLResp
@interface
BUYClient
(
PrivateCheckout
)
@interface
BUYClient
(
PrivateCheckout
)
-
(
BUYRequestOperation
*
)
beginCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
-
(
BUYRequestOperation
*
)
beginCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckoutToken
:(
NSString
*
)
token
start
:(
BOOL
)
start
completion
:(
BUYDataStatusBlock
)
block
;
-
(
BUYRequestOperation
*
)
getCompletionStatusOfCheckout
With
Token
:(
NSString
*
)
token
start
:(
BOOL
)
start
completion
:(
BUYDataStatusBlock
)
block
;
-
(
BUYRequestOperation
*
)
getCheckout
:(
BUYCheckout
*
)
checkout
start
:(
BOOL
)
start
completion
:(
BUYDataCheckoutBlock
)
block
;
-
(
BUYRequestOperation
*
)
getCheckout
:(
BUYCheckout
*
)
checkout
start
:(
BOOL
)
start
completion
:(
BUYDataCheckoutBlock
)
block
;
@end
@end
Mobile Buy SDK/Mobile Buy SDK/Operations/BUYCheckoutOperation.m
View file @
3fe05c4f
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
-
(
BUYRequestOperation
*
)
createPollOperation
-
(
BUYRequestOperation
*
)
createPollOperation
{
{
BUYRequestOperation
*
operation
=
[
self
.
client
getCompletionStatusOfCheckoutToken
:
self
.
checkout
.
token
start
:
NO
completion
:^
(
BUYStatus
status
,
NSError
*
error
)
{
BUYRequestOperation
*
operation
=
[
self
.
client
getCompletionStatusOfCheckout
With
Token
:
self
.
checkout
.
token
start
:
NO
completion
:^
(
BUYStatus
status
,
NSError
*
error
)
{
if
(
status
!=
BUYStatusComplete
)
{
if
(
status
!=
BUYStatusComplete
)
{
[
self
finishWithError
:
error
];
[
self
finishWithError
:
error
];
}
}
...
...
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
View file @
3fe05c4f
...
@@ -295,7 +295,7 @@ const NSTimeInterval PollDelay = 0.5;
...
@@ -295,7 +295,7 @@ const NSTimeInterval PollDelay = 0.5;
dispatch_semaphore_t
semaphore
=
dispatch_semaphore_create
(
0
);
dispatch_semaphore_t
semaphore
=
dispatch_semaphore_create
(
0
);
while
(
checkout
.
token
&&
checkoutStatus
!=
BUYStatusFailed
&&
checkoutStatus
!=
BUYStatusComplete
)
{
while
(
checkout
.
token
&&
checkoutStatus
!=
BUYStatusFailed
&&
checkoutStatus
!=
BUYStatusComplete
)
{
[
self
.
client
getCompletionStatusOfCheckout
:
self
.
checkout
completion
:
^
(
BUYStatus
status
,
NSError
*
error
)
{
[
self
.
client
getCompletionStatusOfCheckout
WithToken
:
self
.
checkout
.
token
completion
:
^
(
BUYStatus
status
,
NSError
*
error
)
{
checkoutStatus
=
status
;
checkoutStatus
=
status
;
self
.
lastError
=
error
;
self
.
lastError
=
error
;
dispatch_semaphore_signal
(
semaphore
);
dispatch_semaphore_signal
(
semaphore
);
...
...
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