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
4c5d7c92
Commit
4c5d7c92
authored
May 12, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor clean up. Add assertions for shop credentials in init.
parent
fdb2606c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
BUYClient.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.h
+1
-3
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+5
-2
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.h
View file @
4c5d7c92
...
...
@@ -26,8 +26,6 @@
@import
Foundation
;
@class
PKPaymentToken
;
@class
BUYAccountCredentials
;
@class
BUYCart
;
@class
BUYCheckout
;
...
...
@@ -459,7 +457,7 @@ typedef void (^BUYDataGiftCardBlock)(BUYGiftCard *giftCard, NSError *error);
*
* @return The associated NSURLSessionDataTask
*/
-
(
NSURLSessionDataTask
*
)
completeCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
-
(
NSURLSessionDataTask
*
)
completeCheckout
:(
BUYCheckout
*
)
checkout
paymentToken
:(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:(
BUYDataCheckoutBlock
)
block
;
/**
* Retrieve the status of a BUYCheckout. This checks the status of the current payment processing job for the provided checkout.
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
4c5d7c92
...
...
@@ -86,7 +86,10 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
instancetype
)
initWithShopDomain
:
(
NSString
*
)
shopDomain
apiKey
:
(
NSString
*
)
apiKey
appId
:
(
NSString
*
)
appId
{
NSAssert
(
shopDomain
.
length
>
0
,
@"Bad shop domain. Please ensure you initialize with a shop domain"
);
NSAssert
(
shopDomain
.
length
>
0
,
@"Bad shop domain. Please ensure you initialize with a shop domain."
);
NSAssert
(
apiKey
.
length
>
0
,
@"Bad API key. Please ensure you initialize with a valid API key."
);
NSAssert
(
appId
.
length
>
0
,
@"Bad app ID. Please ensure you initialize with a valid App ID."
);
self
=
[
super
init
];
if
(
self
)
{
self
.
modelManager
=
[
BUYModelManager
modelManager
];
...
...
@@ -558,7 +561,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
{
NSAssert
(
object
,
@"Failed to perform request. id<BUYSerializable> must not be nil."
);
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:[
object
jsonDictionaryForCheckout
]
options
:
0
error
:
nil
];
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:[
object
jsonDictionaryForCheckout
]
options
:
0
error
:
nil
];
NSAssert
(
data
,
@"Failed to perform request. Could not serialize object. Possibly invalid object."
);
return
[
self
requestForURL
:
url
method
:
method
body
:
data
completionHandler
:
completionHandler
];
...
...
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