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
28bce436
Commit
28bce436
authored
May 31, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert getShippingRates to use token.
parent
9fd7679a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
BUYIntegrationTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
+3
-3
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
+3
-3
BUYApplePayAuthorizationDelegate.m
...K/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
+1
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
View file @
28bce436
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testCheckoutFlowUsingCreditCard_2"
useMocks
:[
self
shouldUseMocks
]];
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testCheckoutFlowUsingCreditCard_2"
useMocks
:[
self
shouldUseMocks
]];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
[
self
.
client
getShippingRatesForCheckout
:
_checkout
completion
:
^
(
NSArray
*
shippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
[
self
.
client
getShippingRatesForCheckout
WithToken
:
_checkout
.
token
completion
:
^
(
NSArray
*
shippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
XCTAssertNil
(
error
);
XCTAssertNil
(
error
);
XCTAssertEqual
(
status
,
BUYStatusComplete
);
XCTAssertEqual
(
status
,
BUYStatusComplete
);
...
@@ -752,7 +752,7 @@
...
@@ -752,7 +752,7 @@
XCTestExpectation
*
expectation2
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
XCTestExpectation
*
expectation2
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
[
self
.
client
getShippingRatesForCheckout
:
_checkout
completion
:
^
(
NSArray
*
returnedShippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
[
self
.
client
getShippingRatesForCheckout
WithToken
:
_checkout
.
token
completion
:
^
(
NSArray
*
returnedShippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
XCTAssertEqual
(
BUYStatusPreconditionFailed
,
status
);
XCTAssertEqual
(
BUYStatusPreconditionFailed
,
status
);
[
expectation2
fulfill
];
[
expectation2
fulfill
];
}];
}];
...
@@ -770,7 +770,7 @@
...
@@ -770,7 +770,7 @@
checkout
.
token
=
@"bananaaaa"
;
checkout
.
token
=
@"bananaaaa"
;
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
[
self
.
client
getShippingRatesForCheckout
:
checkout
completion
:
^
(
NSArray
*
returnedShippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
[
self
.
client
getShippingRatesForCheckout
WithToken
:
checkout
.
token
completion
:
^
(
NSArray
*
returnedShippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
XCTAssertEqual
(
BUYStatusNotFound
,
status
);
XCTAssertEqual
(
BUYStatusNotFound
,
status
);
[
expectation
fulfill
];
[
expectation
fulfill
];
}];
}];
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.h
View file @
28bce436
...
@@ -161,15 +161,15 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
...
@@ -161,15 +161,15 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard * _Nullable giftCard, NSError *
#pragma mark - Shipping Rates -
#pragma mark - Shipping Rates -
/**
/**
* Retrieves a list of applicable shipping rates for a given
BUYCheckout
.
* Retrieves a list of applicable shipping rates for a given
checkout token
.
* Add the preferred/selected BUYShippingRate to BUYCheckout, then update BUYCheckout
* Add the preferred/selected BUYShippingRate to BUYCheckout, then update BUYCheckout
*
*
* @param checkout
The BUYCheckout to retrieve shipping rates for
* @param checkout
Token The checkout token for which to retrieve shipping rates
* @param block (^BUYDataShippingRatesBlock)(NSArray *shippingRates, BUYStatus status, NSError *error);
* @param block (^BUYDataShippingRatesBlock)(NSArray *shippingRates, BUYStatus status, NSError *error);
*
*
* @return The associated BUYRequestOperation
* @return The associated BUYRequestOperation
*/
*/
-
(
BUYRequestOperation
*
)
getShippingRatesForCheckout
:(
BUYCheckout
*
)
checkout
completion
:(
BUYDataShippingRatesBlock
)
block
;
-
(
BUYRequestOperation
*
)
getShippingRatesForCheckout
WithToken
:(
NSString
*
)
checkoutToken
completion
:(
BUYDataShippingRatesBlock
)
block
;
#pragma mark - Cards -
#pragma mark - Cards -
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.m
View file @
28bce436
...
@@ -191,11 +191,11 @@
...
@@ -191,11 +191,11 @@
#pragma mark - Shipping Rates -
#pragma mark - Shipping Rates -
-
(
BUYRequestOperation
*
)
getShippingRatesForCheckout
:(
BUYCheckout
*
)
checkout
completion
:(
BUYDataShippingRatesBlock
)
block
-
(
BUYRequestOperation
*
)
getShippingRatesForCheckout
WithToken
:(
NSString
*
)
checkoutToken
completion
:(
BUYDataShippingRatesBlock
)
block
{
{
BUYAssert
Checkout
(
checkout
);
BUYAssert
Token
(
checkoutToken
);
NSURL
*
url
=
[
self
urlForCheckoutsShippingRatesWithToken
:
checkout
.
t
oken
parameters
:@{
NSURL
*
url
=
[
self
urlForCheckoutsShippingRatesWithToken
:
checkout
T
oken
parameters
:@{
@"checkout"
:
@""
,
@"checkout"
:
@""
,
}];
}];
...
...
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAuthorizationDelegate.m
View file @
28bce436
...
@@ -242,7 +242,7 @@ const NSTimeInterval PollDelay = 0.5;
...
@@ -242,7 +242,7 @@ const NSTimeInterval PollDelay = 0.5;
dispatch_semaphore_t
semaphore
=
dispatch_semaphore_create
(
0
);
dispatch_semaphore_t
semaphore
=
dispatch_semaphore_create
(
0
);
__block
BUYStatus
shippingStatus
=
BUYStatusUnknown
;
__block
BUYStatus
shippingStatus
=
BUYStatusUnknown
;
do
{
do
{
[
self
.
client
getShippingRatesForCheckout
:
self
.
checkout
completion
:
^
(
NSArray
*
shippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
[
self
.
client
getShippingRatesForCheckout
WithToken
:
self
.
checkout
.
token
completion
:
^
(
NSArray
*
shippingRates
,
BUYStatus
status
,
NSError
*
error
)
{
shippingStatus
=
status
;
shippingStatus
=
status
;
if
(
error
)
{
if
(
error
)
{
...
...
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