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
b3601806
Commit
b3601806
authored
May 17, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move BUYAuthenticatedResponse into separate file.
parent
87c76025
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
24 deletions
+105
-24
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+14
-0
BUYClient+Customers.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
+3
-24
BUYAuthenticatedResponse.h
... Buy SDK/Mobile Buy SDK/Models/BUYAuthenticatedResponse.h
+37
-0
BUYAuthenticatedResponse.m
... Buy SDK/Mobile Buy SDK/Models/BUYAuthenticatedResponse.m
+51
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
b3601806
...
@@ -351,6 +351,10 @@
...
@@ -351,6 +351,10 @@
9A0B0C731CEB52B90037D68F
/* BUYClient+Checkout.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C701CEB52B90037D68F
/* BUYClient+Checkout.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A0B0C731CEB52B90037D68F
/* BUYClient+Checkout.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C701CEB52B90037D68F
/* BUYClient+Checkout.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A0B0C741CEB52B90037D68F
/* BUYClient+Checkout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
;
};
9A0B0C741CEB52B90037D68F
/* BUYClient+Checkout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
;
};
9A0B0C751CEB52B90037D68F
/* BUYClient+Checkout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
;
};
9A0B0C751CEB52B90037D68F
/* BUYClient+Checkout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
;
};
9A0B0C781CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C761CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h */
;
};
9A0B0C791CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C761CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h */
;
};
9A0B0C7A1CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C771CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m */
;
};
9A0B0C7B1CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C771CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m */
;
};
9A102D1B1CDD1F960026CC43
/* BUYErrorTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A102D1A1CDD1F960026CC43
/* BUYErrorTests.m */
;
};
9A102D1B1CDD1F960026CC43
/* BUYErrorTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A102D1A1CDD1F960026CC43
/* BUYErrorTests.m */
;
};
9A102D1E1CDD25980026CC43
/* BUYOptionValueTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A102D1D1CDD25980026CC43
/* BUYOptionValueTests.m */
;
};
9A102D1E1CDD25980026CC43
/* BUYOptionValueTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A102D1D1CDD25980026CC43
/* BUYOptionValueTests.m */
;
};
9A47CEFD1CE39F6000A6D5BA
/* BUYCreditCardToken.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A47CEFB1CE39F5B00A6D5BA
/* BUYCreditCardToken.m */
;
};
9A47CEFD1CE39F6000A6D5BA
/* BUYCreditCardToken.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A47CEFB1CE39F5B00A6D5BA
/* BUYCreditCardToken.m */
;
};
...
@@ -631,6 +635,8 @@
...
@@ -631,6 +635,8 @@
9A0B0C6B1CEB4D300037D68F
/* BUYClient+Storefront.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYClient+Storefront.m"
;
sourceTree
=
"<group>"
;
};
9A0B0C6B1CEB4D300037D68F
/* BUYClient+Storefront.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYClient+Storefront.m"
;
sourceTree
=
"<group>"
;
};
9A0B0C701CEB52B90037D68F
/* BUYClient+Checkout.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"BUYClient+Checkout.h"
;
sourceTree
=
"<group>"
;
};
9A0B0C701CEB52B90037D68F
/* BUYClient+Checkout.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"BUYClient+Checkout.h"
;
sourceTree
=
"<group>"
;
};
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYClient+Checkout.m"
;
sourceTree
=
"<group>"
;
};
9A0B0C711CEB52B90037D68F
/* BUYClient+Checkout.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYClient+Checkout.m"
;
sourceTree
=
"<group>"
;
};
9A0B0C761CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYAuthenticatedResponse.h
;
sourceTree
=
"<group>"
;
};
9A0B0C771CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYAuthenticatedResponse.m
;
sourceTree
=
"<group>"
;
};
9A102D1A1CDD1F960026CC43
/* BUYErrorTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYErrorTests.m
;
sourceTree
=
"<group>"
;
};
9A102D1A1CDD1F960026CC43
/* BUYErrorTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYErrorTests.m
;
sourceTree
=
"<group>"
;
};
9A102D1D1CDD25980026CC43
/* BUYOptionValueTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYOptionValueTests.m
;
sourceTree
=
"<group>"
;
};
9A102D1D1CDD25980026CC43
/* BUYOptionValueTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYOptionValueTests.m
;
sourceTree
=
"<group>"
;
};
9A47CEF81CE39EC200A6D5BA
/* BUYPaymentToken.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYPaymentToken.h
;
sourceTree
=
"<group>"
;
};
9A47CEF81CE39EC200A6D5BA
/* BUYPaymentToken.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYPaymentToken.h
;
sourceTree
=
"<group>"
;
};
...
@@ -1044,6 +1050,8 @@
...
@@ -1044,6 +1050,8 @@
F773744419C779C20039681C
/* Models */
=
{
F773744419C779C20039681C
/* Models */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
9A0B0C761CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h */
,
9A0B0C771CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m */
,
8498DCB91CDD1FA400BD12A8
/* BUYAccountCredentials.h */
,
8498DCB91CDD1FA400BD12A8
/* BUYAccountCredentials.h */
,
8498DCBA1CDD1FA400BD12A8
/* BUYAccountCredentials.m */
,
8498DCBA1CDD1FA400BD12A8
/* BUYAccountCredentials.m */
,
F77374AA19C796BD0039681C
/* BUYCreditCard.h */
,
F77374AA19C796BD0039681C
/* BUYCreditCard.h */
,
...
@@ -1226,6 +1234,8 @@
...
@@ -1226,6 +1234,8 @@
9019315F1BC5B9BC00D1134E
/* BUYProductHeaderCell.h in Headers */
,
9019315F1BC5B9BC00D1134E
/* BUYProductHeaderCell.h in Headers */
,
901931601BC5B9BC00D1134E
/* BUYProductViewErrorView.h in Headers */
,
901931601BC5B9BC00D1134E
/* BUYProductViewErrorView.h in Headers */
,
901931611BC5B9BC00D1134E
/* BUYClient.h in Headers */
,
901931611BC5B9BC00D1134E
/* BUYClient.h in Headers */
,
901931631BC5B9BC00D1134E
/* BUYGradientView.h in Headers */
,
9A0B0C791CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h in Headers */
,
849810971CB7E07900CFAB58
/* BUYFlatCollectionTransformer.h in Headers */
,
849810971CB7E07900CFAB58
/* BUYFlatCollectionTransformer.h in Headers */
,
901931641BC5B9BC00D1134E
/* BUYCartLineItem.h in Headers */
,
901931641BC5B9BC00D1134E
/* BUYCartLineItem.h in Headers */
,
8498DCAE1CDD1B2F00BD12A8
/* BUYError+BUYAdditions.h in Headers */
,
8498DCAE1CDD1B2F00BD12A8
/* BUYError+BUYAdditions.h in Headers */
,
...
@@ -1329,6 +1339,8 @@
...
@@ -1329,6 +1339,8 @@
BEB74A6D1B5564200005A300
/* BUYProductHeaderCell.h in Headers */
,
BEB74A6D1B5564200005A300
/* BUYProductHeaderCell.h in Headers */
,
903BCC7C1B7D1C2D00C21FEB
/* BUYProductViewErrorView.h in Headers */
,
903BCC7C1B7D1C2D00C21FEB
/* BUYProductViewErrorView.h in Headers */
,
BE9A64471B503C8B0033E558
/* BUYClient.h in Headers */
,
BE9A64471B503C8B0033E558
/* BUYClient.h in Headers */
,
BEB74A651B5563FF0005A300
/* BUYGradientView.h in Headers */
,
9A0B0C781CEB5BBD0037D68F
/* BUYAuthenticatedResponse.h in Headers */
,
849810961CB7E07900CFAB58
/* BUYFlatCollectionTransformer.h in Headers */
,
849810961CB7E07900CFAB58
/* BUYFlatCollectionTransformer.h in Headers */
,
9003969B1B601DF400226B73
/* BUYCartLineItem.h in Headers */
,
9003969B1B601DF400226B73
/* BUYCartLineItem.h in Headers */
,
8498DCAC1CDD1B2F00BD12A8
/* BUYError+BUYAdditions.h in Headers */
,
8498DCAC1CDD1B2F00BD12A8
/* BUYError+BUYAdditions.h in Headers */
,
...
@@ -1554,6 +1566,7 @@
...
@@ -1554,6 +1566,7 @@
84DD12AE1CC63FE600A2442D
/* _BUYProductVariant.m in Sources */
,
84DD12AE1CC63FE600A2442D
/* _BUYProductVariant.m in Sources */
,
84B0A7211CDD261100253EB0
/* BUYSerializable.m in Sources */
,
84B0A7211CDD261100253EB0
/* BUYSerializable.m in Sources */
,
9A47CEFE1CE39F6100A6D5BA
/* BUYCreditCardToken.m in Sources */
,
9A47CEFE1CE39F6100A6D5BA
/* BUYCreditCardToken.m in Sources */
,
9A0B0C7B1CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m in Sources */
,
901930F21BC5B9BC00D1134E
/* BUYOrder.m in Sources */
,
901930F21BC5B9BC00D1134E
/* BUYOrder.m in Sources */
,
849810991CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m in Sources */
,
849810991CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m in Sources */
,
84DD12A41CC63FE600A2442D
/* _BUYLineItem.m in Sources */
,
84DD12A41CC63FE600A2442D
/* _BUYLineItem.m in Sources */
,
...
@@ -1689,6 +1702,7 @@
...
@@ -1689,6 +1702,7 @@
84DD12961CC63FE600A2442D
/* _BUYProductVariant.m in Sources */
,
84DD12961CC63FE600A2442D
/* _BUYProductVariant.m in Sources */
,
84B0A7201CDD261100253EB0
/* BUYSerializable.m in Sources */
,
84B0A7201CDD261100253EB0
/* BUYSerializable.m in Sources */
,
9A47CEFD1CE39F6000A6D5BA
/* BUYCreditCardToken.m in Sources */
,
9A47CEFD1CE39F6000A6D5BA
/* BUYCreditCardToken.m in Sources */
,
9A0B0C7A1CEB5BBD0037D68F
/* BUYAuthenticatedResponse.m in Sources */
,
90E83BC51B9F550E00C95A1B
/* BUYOrder.m in Sources */
,
90E83BC51B9F550E00C95A1B
/* BUYOrder.m in Sources */
,
849810981CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m in Sources */
,
849810981CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m in Sources */
,
84DD128C1CC63FE600A2442D
/* _BUYLineItem.m in Sources */
,
84DD128C1CC63FE600A2442D
/* _BUYLineItem.m in Sources */
,
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Customers.m
View file @
b3601806
...
@@ -30,31 +30,10 @@
...
@@ -30,31 +30,10 @@
#import "NSDateFormatter+BUYAdditions.h"
#import "NSDateFormatter+BUYAdditions.h"
#import "BUYCustomer.h"
#import "BUYCustomer.h"
#import "BUYAccountCredentials.h"
#import "BUYAccountCredentials.h"
#import "BUYAuthenticatedResponse.h"
#import "BUYOrder.h"
#import "BUYOrder.h"
#import "BUYShopifyErrorCodes.h"
#import "BUYShopifyErrorCodes.h"
@interface
BUYAuthenticatedResponse
:
NSObject
+
(
BUYAuthenticatedResponse
*
)
responseFromJSON
:(
NSDictionary
*
)
json
;
@property
(
nonatomic
,
copy
)
NSString
*
accessToken
;
@property
(
nonatomic
,
copy
)
NSDate
*
expiry
;
@property
(
nonatomic
,
copy
)
NSString
*
customerID
;
@end
@implementation
BUYAuthenticatedResponse
+
(
BUYAuthenticatedResponse
*
)
responseFromJSON
:(
NSDictionary
*
)
json
{
BUYAuthenticatedResponse
*
response
=
[
BUYAuthenticatedResponse
new
];
NSDictionary
*
access
=
json
[
@"customer_access_token"
];
response
.
accessToken
=
access
[
@"access_token"
];
NSDateFormatter
*
formatter
=
[
NSDateFormatter
dateFormatterForPublications
];
response
.
expiry
=
[
formatter
dateFromString
:
access
[
@"expires_at"
]];
response
.
customerID
=
[
NSString
stringWithFormat
:
@"%@"
,
access
[
@"customer_id"
]];
return
response
;
}
@end
@implementation
BUYClient
(
Customers
)
@implementation
BUYClient
(
Customers
)
#pragma mark - Customer
#pragma mark - Customer
...
@@ -89,7 +68,7 @@
...
@@ -89,7 +68,7 @@
NSURL
*
route
=
[
self
routeForCustomersToken
];
NSURL
*
route
=
[
self
routeForCustomersToken
];
return
[
self
postRequestForURL
:
route
object
:
credentials
.
JSONRepresentation
completionHandler
:^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
postRequestForURL
:
route
object
:
credentials
.
JSONRepresentation
completionHandler
:^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
BUYAuthenticatedResponse
*
authenticatedResponse
=
[
BUYAuthenticatedResponse
response
From
JSON
:
json
];
BUYAuthenticatedResponse
*
authenticatedResponse
=
[
BUYAuthenticatedResponse
response
With
JSON
:
json
];
self
.
customerToken
=
authenticatedResponse
.
accessToken
;
self
.
customerToken
=
authenticatedResponse
.
accessToken
;
if
(
!
customerJSON
)
{
if
(
!
customerJSON
)
{
...
@@ -136,7 +115,7 @@
...
@@ -136,7 +115,7 @@
NSString
*
accessToken
=
nil
;
NSString
*
accessToken
=
nil
;
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
BUYAuthenticatedResponse
*
authenticatedResponse
=
[
BUYAuthenticatedResponse
response
From
JSON
:
json
];
BUYAuthenticatedResponse
*
authenticatedResponse
=
[
BUYAuthenticatedResponse
response
With
JSON
:
json
];
accessToken
=
authenticatedResponse
.
accessToken
;
accessToken
=
authenticatedResponse
.
accessToken
;
}
}
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAuthenticatedResponse.h
0 → 100644
View file @
b3601806
//
// BUYAuthenticatedResponse.h
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2016 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <Foundation/Foundation.h>
@interface
BUYAuthenticatedResponse
:
NSObject
@property
(
nonatomic
,
copy
,
readonly
)
NSString
*
accessToken
;
@property
(
nonatomic
,
copy
,
readonly
)
NSDate
*
expiry
;
@property
(
nonatomic
,
copy
,
readonly
)
NSString
*
customerID
;
+
(
BUYAuthenticatedResponse
*
)
responseWithJSON
:(
NSDictionary
*
)
json
;
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAuthenticatedResponse.m
0 → 100644
View file @
b3601806
//
// BUYAuthenticatedResponse.m
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2016 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "BUYAuthenticatedResponse.h"
#import "NSDateFormatter+BUYAdditions.h"
@implementation
BUYAuthenticatedResponse
+
(
BUYAuthenticatedResponse
*
)
responseWithJSON
:(
NSDictionary
*
)
json
{
return
[[[
self
class
]
alloc
]
initWithJSON
:
json
];
}
-
(
instancetype
)
initWithJSON
:(
NSDictionary
*
)
json
{
self
=
[
super
init
];
if
(
self
)
{
NSDateFormatter
*
formatter
=
[
NSDateFormatter
dateFormatterForPublications
];
NSDictionary
*
access
=
json
[
@"customer_access_token"
];
_accessToken
=
access
[
@"access_token"
];
_expiry
=
[
formatter
dateFromString
:
access
[
@"expires_at"
]];
_customerID
=
[
NSString
stringWithFormat
:
@"%@"
,
access
[
@"customer_id"
]];
}
return
self
;
}
@end
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