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
543283c8
Commit
543283c8
authored
May 12, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor card vaulting to assert instead of return error.
parent
f1720a63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+3
-7
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
543283c8
...
@@ -515,7 +515,6 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -515,7 +515,6 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
storeCreditCard
:
(
BUYCreditCard
*
)
creditCard
checkout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCreditCardBlock
)
completion
-
(
NSURLSessionDataTask
*
)
storeCreditCard
:
(
BUYCreditCard
*
)
creditCard
checkout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCreditCardBlock
)
completion
{
{
NSAssert
(
checkout
,
@"Failed to store credit card. No checkout provided."
);
NSAssert
(
checkout
.
token
,
@"Failed to store credit card. No checkout token provided."
);
NSAssert
(
checkout
.
token
,
@"Failed to store credit card. No checkout token provided."
);
NSAssert
(
creditCard
,
@"Failed to store credit card. No credit card provided."
);
NSAssert
(
creditCard
,
@"Failed to store credit card. No credit card provided."
);
...
@@ -527,13 +526,10 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -527,13 +526,10 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
}
}
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:@{
@"checkout"
:
json
}
options
:
0
error
:
nil
];
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:@{
@"checkout"
:
json
}
options
:
0
error
:
nil
];
if
(
data
)
{
return
[
self
postPaymentRequestWithCheckout
:
checkout
body
:
data
completion
:
completion
];
}
else
{
NSAssert
(
data
,
@"Failed to store credit card. Unable to serialize JSON payload. Possibly invalid credit card object."
);
completion
(
nil
,
nil
,
[
NSError
errorWithDomain
:
kShopifyError
code
:
BUYShopifyError_InvalidCheckoutObject
userInfo
:
nil
]);
return
nil
;
return
[
self
postPaymentRequestWithCheckout
:
checkout
body
:
data
completion
:
completion
];
}
}
}
-
(
NSURLSessionDataTask
*
)
removeProductReservationsFromCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutBlock
)
block
-
(
NSURLSessionDataTask
*
)
removeProductReservationsFromCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutBlock
)
block
...
...
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