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
1cc02e5b
Commit
1cc02e5b
authored
Jul 20, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method for clarity.
parent
8c219ebd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
BUYClient+Customers.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
+1
-1
BUYCustomerToken.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCustomerToken.h
+1
-1
BUYCustomerToken.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCustomerToken.m
+7
-2
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
View file @
1cc02e5b
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
NSURL
*
url
=
[
self
urlForCustomersToken
];
NSURL
*
url
=
[
self
urlForCustomersToken
];
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
)
{
self
.
customerToken
=
[
BUYCustomerToken
customerTokenWithJSON
:
json
];
self
.
customerToken
=
[
BUYCustomerToken
customerTokenWithJSON
Dictionary
:
json
];
if
(
!
customerJSON
)
{
if
(
!
customerJSON
)
{
[
self
getCustomerCallback
:
^
(
BUYCustomer
*
customer
,
NSError
*
error
)
{
[
self
getCustomerCallback
:
^
(
BUYCustomer
*
customer
,
NSError
*
error
)
{
block
(
customer
,
self
.
customerToken
,
error
);
block
(
customer
,
self
.
customerToken
,
error
);
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCustomerToken.h
View file @
1cc02e5b
...
@@ -35,6 +35,6 @@
...
@@ -35,6 +35,6 @@
-
(
instancetype
)
init
NS_UNAVAILABLE
;
-
(
instancetype
)
init
NS_UNAVAILABLE
;
-
(
instancetype
)
initWithCustomerID
:(
NSNumber
*
)
customerID
accessToken
:(
NSString
*
)
accessToken
expiry
:(
NSDate
*
)
expiry
;
-
(
instancetype
)
initWithCustomerID
:(
NSNumber
*
)
customerID
accessToken
:(
NSString
*
)
accessToken
expiry
:(
NSDate
*
)
expiry
;
+
(
BUYCustomerToken
*
)
customerTokenWithJSON
:(
NSDictionary
*
)
json
;
+
(
BUYCustomerToken
*
)
customerTokenWithJSON
Dictionary
:(
NSDictionary
*
)
json
;
@end
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCustomerToken.m
View file @
1cc02e5b
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#import "BUYCustomerToken.h"
#import "BUYCustomerToken.h"
#import "NSDateFormatter+BUYAdditions.h"
#import "NSDateFormatter+BUYAdditions.h"
#import "NSDictionary+BUYAdditions.h"
static
NSString
*
const
customerAccessTokenKey
=
@"customer_access_token"
;
static
NSString
*
const
customerAccessTokenKey
=
@"customer_access_token"
;
static
NSString
*
const
accessTokenKey
=
@"access_token"
;
static
NSString
*
const
accessTokenKey
=
@"access_token"
;
...
@@ -36,6 +37,10 @@ static NSString * const customerIDKey = @"customer_id";
...
@@ -36,6 +37,10 @@ static NSString * const customerIDKey = @"customer_id";
-
(
instancetype
)
initWithCustomerID
:(
NSNumber
*
)
customerID
accessToken
:(
NSString
*
)
accessToken
expiry
:(
NSDate
*
)
expiry
-
(
instancetype
)
initWithCustomerID
:(
NSNumber
*
)
customerID
accessToken
:(
NSString
*
)
accessToken
expiry
:(
NSDate
*
)
expiry
{
{
NSParameterAssert
(
customerID
);
NSParameterAssert
(
accessToken
);
NSParameterAssert
(
expiry
);
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
if
(
self
)
{
_customerID
=
customerID
;
_customerID
=
customerID
;
...
@@ -45,7 +50,7 @@ static NSString * const customerIDKey = @"customer_id";
...
@@ -45,7 +50,7 @@ static NSString * const customerIDKey = @"customer_id";
return
self
;
return
self
;
}
}
+
(
BUYCustomerToken
*
)
customerTokenWithJSON
:(
NSDictionary
*
)
json
+
(
BUYCustomerToken
*
)
customerTokenWithJSON
Dictionary
:(
NSDictionary
*
)
json
{
{
return
[[
self
alloc
]
initWithJSON
:
json
];
return
[[
self
alloc
]
initWithJSON
:
json
];
}
}
...
@@ -53,7 +58,7 @@ static NSString * const customerIDKey = @"customer_id";
...
@@ -53,7 +58,7 @@ static NSString * const customerIDKey = @"customer_id";
-
(
instancetype
)
initWithJSON
:(
NSDictionary
*
)
json
-
(
instancetype
)
initWithJSON
:(
NSDictionary
*
)
json
{
{
NSDateFormatter
*
formatter
=
[
NSDateFormatter
dateFormatterForPublications
];
NSDateFormatter
*
formatter
=
[
NSDateFormatter
dateFormatterForPublications
];
NSDictionary
*
access
=
json
[
customerAccessTokenKey
];
NSDictionary
*
access
=
json
[
customerAccessTokenKey
]
?:
json
;
NSNumber
*
customerID
=
access
[
customerIDKey
];
NSNumber
*
customerID
=
access
[
customerIDKey
];
NSString
*
accessToken
=
access
[
accessTokenKey
];
NSString
*
accessToken
=
access
[
accessTokenKey
];
...
...
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