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
c8f04698
Commit
c8f04698
authored
8 years ago
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder methods.
parent
b28b83ec
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+12
-12
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
c8f04698
...
...
@@ -80,6 +80,8 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
@implementation
BUYClient
#pragma mark - Init
-
(
instancetype
)
init
{
BUYAssert
(
NO
,
@"BUYClient must be initialized using the designated initializer."
);
return
nil
;
...
...
@@ -248,18 +250,6 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
}];
}
#pragma mark - Helpers
-
(
NSError
*
)
extractErrorFromResponse
:
(
NSURLResponse
*
)
response
json
:
(
NSDictionary
*
)
json
{
NSError
*
error
=
nil
;
NSInteger
statusCode
=
[((
NSHTTPURLResponse
*
)
response
)
statusCode
];
if
(
statusCode
<
kMinSuccessfulStatusCode
||
statusCode
>
kMaxSuccessfulStatusCode
)
{
error
=
[
NSError
errorWithDomain
:
NSURLErrorDomain
code
:
statusCode
userInfo
:
json
];
}
return
error
;
}
#pragma mark - URL Components
-
(
NSURLComponents
*
)
URLComponentsForChannelsAppendingPath
:
(
NSString
*
)
appendingPath
queryItems
:
(
NSDictionary
*
)
queryItems
...
...
@@ -555,6 +545,16 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
return
[[
NSError
alloc
]
initWithDomain
:
kShopifyError
code
:
statusCode
userInfo
:
errorDictionary
];
}
-
(
NSError
*
)
extractErrorFromResponse
:
(
NSURLResponse
*
)
response
json
:
(
NSDictionary
*
)
json
{
NSError
*
error
=
nil
;
NSInteger
statusCode
=
[((
NSHTTPURLResponse
*
)
response
)
statusCode
];
if
(
statusCode
<
kMinSuccessfulStatusCode
||
statusCode
>
kMaxSuccessfulStatusCode
)
{
error
=
[
NSError
errorWithDomain
:
NSURLErrorDomain
code
:
statusCode
userInfo
:
json
];
}
return
error
;
}
#pragma mark - Convenience Requests
-
(
NSURLSessionDataTask
*
)
getRequestForURL
:
(
NSURL
*
)
url
completionHandler
:
(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
...
...
This diff is collapsed.
Click to expand it.
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