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
a5f35086
Commit
a5f35086
authored
Jul 19, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change BUYClient.customerToken from string to BUYCustomerToken.
parent
e81100f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
BUYClient+Customers.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
+4
-4
BUYClient.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.h
+3
-2
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+2
-1
BUYWebCheckoutPaymentProvider.m
...Buy SDK/Payment Providers/BUYWebCheckoutPaymentProvider.m
+4
-3
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
View file @
a5f35086
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
return
[
self
putRequestForURL
:
url
object
:
nil
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
putRequestForURL
:
url
object
:
nil
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
NSString
*
accessToken
=
nil
;
NSString
*
accessToken
=
nil
;
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
BUYCustomerToken
*
authenticatedResponse
=
[
BUYCustomerToken
response
WithJSON
:
json
];
BUYCustomerToken
*
authenticatedResponse
=
[
BUYCustomerToken
customerToken
WithJSON
:
json
];
accessToken
=
authenticatedResponse
.
accessToken
;
accessToken
=
authenticatedResponse
.
accessToken
;
}
}
...
@@ -191,16 +191,16 @@
...
@@ -191,16 +191,16 @@
return
[
self
postRequestForURL
:
url
object
:
credentials
.
JSONRepresentation
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
postRequestForURL
:
url
object
:
credentials
.
JSONRepresentation
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
BUYCustomerToken
*
authenticatedResponse
=
[
BUYCustomerToken
customerTokenWithJSON
:
json
];
BUYCustomerToken
*
authenticatedResponse
=
[
BUYCustomerToken
customerTokenWithJSON
:
json
];
self
.
customerToken
=
authenticatedResponse
.
accessToken
;
self
.
customerToken
=
authenticatedResponse
;
if
(
!
customerJSON
)
{
if
(
!
customerJSON
)
{
[
self
getCustomerWithID
:
authenticatedResponse
.
customerID
callback
:
^
(
BUYCustomer
*
customer
,
NSError
*
error
)
{
[
self
getCustomerWithID
:
authenticatedResponse
.
customerID
callback
:
^
(
BUYCustomer
*
customer
,
NSError
*
error
)
{
block
(
customer
,
self
.
customerToken
,
error
);
block
(
customer
,
self
.
customerToken
.
accessToken
,
error
);
}];
}];
}
}
else
{
else
{
BUYCustomer
*
customer
=
[
self
.
modelManager
customerWithJSONDictionary
:
customerJSON
];
BUYCustomer
*
customer
=
[
self
.
modelManager
customerWithJSONDictionary
:
customerJSON
];
block
(
customer
,
self
.
customerToken
,
error
);
block
(
customer
,
self
.
customerToken
.
accessToken
,
error
);
}
}
}
}
else
{
else
{
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.h
View file @
a5f35086
...
@@ -25,8 +25,9 @@
...
@@ -25,8 +25,9 @@
//
//
@import
Foundation
;
@import
Foundation
;
#import
"BUYClientTypes.h"
#import
<Buy/BUYClientTypes.h>
@class
BUYCustomerToken
;
@class
BUYModelManager
;
@class
BUYModelManager
;
@class
BUYOperation
;
@class
BUYOperation
;
@class
BUYRequestOperation
;
@class
BUYRequestOperation
;
...
@@ -97,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -97,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
*
*
* @param token The token received from the create and login callbacks
* @param token The token received from the create and login callbacks
*/
*/
@property
(
strong
,
nonatomic
,
nullable
)
NSString
*
customerToken
;
@property
(
strong
,
nonatomic
,
nullable
)
BUYCustomerToken
*
customerToken
;
@end
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
a5f35086
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#import "BUYClient+Internal.h"
#import "BUYClient+Internal.h"
#import "BUYAssert.h"
#import "BUYAssert.h"
#import "BUYCustomerToken.h"
#import "BUYModelManager.h"
#import "BUYModelManager.h"
#import "BUYRequestOperation.h"
#import "BUYRequestOperation.h"
...
@@ -222,7 +223,7 @@ static NSString * const BUYClientJSONMimeType = @"application/json";
...
@@ -222,7 +223,7 @@ static NSString * const BUYClientJSONMimeType = @"application/json";
[
request
addValue
:
BUYClientJSONMimeType
forHTTPHeaderField
:
@"Accept"
];
[
request
addValue
:
BUYClientJSONMimeType
forHTTPHeaderField
:
@"Accept"
];
if
(
self
.
customerToken
)
{
if
(
self
.
customerToken
)
{
[
request
addValue
:
self
.
customerToken
forHTTPHeaderField
:
BUYClientCustomerAccessToken
];
[
request
addValue
:
self
.
customerToken
.
accessToken
forHTTPHeaderField
:
BUYClientCustomerAccessToken
];
}
}
request
.
HTTPMethod
=
method
;
request
.
HTTPMethod
=
method
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Payment Providers/BUYWebCheckoutPaymentProvider.m
View file @
a5f35086
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#import "BUYWebCheckoutPaymentProvider.h"
#import "BUYWebCheckoutPaymentProvider.h"
#import "BUYCheckout.h"
#import "BUYCheckout.h"
#import "BUYClient+Checkout.h"
#import "BUYClient+Checkout.h"
#import "BUYCustomerToken.h"
#import "BUYAssert.h"
#import "BUYAssert.h"
@import
SafariServices
;
@import
SafariServices
;
...
@@ -176,11 +177,11 @@ static NSString *const WebCheckoutCustomerAccessToken = @"customer_access_token"
...
@@ -176,11 +177,11 @@ static NSString *const WebCheckoutCustomerAccessToken = @"customer_access_token"
-
(
NSURL
*
)
authenticatedWebCheckoutURL
:
(
NSURL
*
)
url
-
(
NSURL
*
)
authenticatedWebCheckoutURL
:
(
NSURL
*
)
url
{
{
NSString
*
customerToken
=
self
.
client
.
customer
Token
;
NSString
*
accessToken
=
self
.
client
.
customerToken
.
access
Token
;
if
(
!
customer
Token
.
length
)
{
if
(
!
access
Token
.
length
)
{
return
url
;
return
url
;
}
}
NSURLQueryItem
*
item
=
[
NSURLQueryItem
queryItemWithName
:
WebCheckoutCustomerAccessToken
value
:
customer
Token
];
NSURLQueryItem
*
item
=
[
NSURLQueryItem
queryItemWithName
:
WebCheckoutCustomerAccessToken
value
:
access
Token
];
NSURLComponents
*
authenticatedComponents
=
[
NSURLComponents
componentsWithURL
:
url
resolvingAgainstBaseURL
:
YES
];
NSURLComponents
*
authenticatedComponents
=
[
NSURLComponents
componentsWithURL
:
url
resolvingAgainstBaseURL
:
YES
];
authenticatedComponents
.
queryItems
=
authenticatedComponents
.
queryItems
?
[
authenticatedComponents
.
queryItems
arrayByAddingObject
:
item
]
:
@[
item
];
authenticatedComponents
.
queryItems
=
authenticatedComponents
.
queryItems
?
[
authenticatedComponents
.
queryItems
arrayByAddingObject
:
item
]
:
@[
item
];
return
authenticatedComponents
.
URL
;
return
authenticatedComponents
.
URL
;
...
...
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