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
1fc243ad
Commit
1fc243ad
authored
9 years ago
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove paymentSessionID from BUYCheckout.
parent
c0f2fbeb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
28 deletions
+11
-28
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+8
-15
BUYCreditCardToken.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCardToken.m
+2
-0
contents
... Buy SDK.xcdatamodeld/Mobile Buy SDK.xcdatamodel/contents
+1
-6
_BUYCheckout.h
...le Buy SDK/Mobile Buy SDK/Models/Transient/_BUYCheckout.h
+0
-6
_BUYCheckout.m
...le Buy SDK/Mobile Buy SDK/Models/Transient/_BUYCheckout.m
+0
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
1fc243ad
...
@@ -420,8 +420,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -420,8 +420,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
updateCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutBlock
)
block
-
(
NSURLSessionDataTask
*
)
updateCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutBlock
)
block
{
{
NSAssert
(
checkout
,
@"Failed to update checkout. Checkout must not be nil"
);
NSAssert
([
checkout
hasToken
],
@"Failed to update checkout. Checkout must have a valid token associated with it."
);
NSAssert
([
checkout
hasToken
],
@"Failed to update checkout. Checkout must have a valid token associated with it/"
);
NSDictionary
*
json
=
[
checkout
jsonDictionaryForCheckout
];
NSDictionary
*
json
=
[
checkout
jsonDictionaryForCheckout
];
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:
json
options
:
0
error
:
nil
];
NSData
*
data
=
[
NSJSONSerialization
dataWithJSONObject
:
json
options
:
0
error
:
nil
];
...
@@ -436,8 +435,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -436,8 +435,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
completeCheckout
:
(
BUYCheckout
*
)
checkout
paymentToken
:
(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:
(
BUYDataCheckoutBlock
)
block
-
(
NSURLSessionDataTask
*
)
completeCheckout
:
(
BUYCheckout
*
)
checkout
paymentToken
:
(
id
<
BUYPaymentToken
>
)
paymentToken
completion
:
(
BUYDataCheckoutBlock
)
block
{
{
NSAssert
(
checkout
,
@"Failed to complete checkout. Checkout must not be nil"
);
NSAssert
([
checkout
hasToken
],
@"Failed to complete checkout. Checkout must have a valid token associated with it."
);
NSAssert
([
checkout
hasToken
],
@"Failed to complete checkout. Checkout must have a valid token associated with it/"
);
NSData
*
data
=
nil
;
NSData
*
data
=
nil
;
if
(
paymentToken
)
{
if
(
paymentToken
)
{
...
@@ -463,8 +461,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -463,8 +461,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
getCompletionStatusOfCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutStatusBlock
)
block
-
(
NSURLSessionDataTask
*
)
getCompletionStatusOfCheckout
:
(
BUYCheckout
*
)
checkout
completion
:
(
BUYDataCheckoutStatusBlock
)
block
{
{
NSAssert
(
checkout
,
@"Failed to get completetion status of checkout. Checkout must not be nil"
);
NSAssert
([
checkout
hasToken
],
@"Failed to get complete status of checkout. Checkout must have a valid token associated with it."
);
NSAssert
([
checkout
hasToken
],
@"Failed to get complete status of checkout. Checkout must have a valid token associated with it/"
);
return
[
self
getCompletionStatusOfCheckoutToken
:
checkout
.
token
completion
:
block
];
return
[
self
getCompletionStatusOfCheckoutToken
:
checkout
.
token
completion
:
block
];
}
}
...
@@ -541,10 +538,7 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -541,10 +538,7 @@ 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
)
{
if
(
data
)
{
return
[
self
postPaymentRequestWithCheckout
:
checkout
body
:
data
completion
:^
(
BUYCheckout
*
checkout
,
NSString
*
paymentSessionId
,
NSError
*
error
)
{
return
[
self
postPaymentRequestWithCheckout
:
checkout
body
:
data
completion
:
completion
];
id
<
BUYPaymentToken
>
provider
=
[[
BUYCreditCardToken
alloc
]
initWithPaymentSessionID
:
paymentSessionId
];
completion
(
checkout
,
provider
,
error
);
}];
}
else
{
}
else
{
completion
(
nil
,
nil
,
[
NSError
errorWithDomain
:
kShopifyError
code
:
BUYShopifyError_InvalidCheckoutObject
userInfo
:
nil
]);
completion
(
nil
,
nil
,
[
NSError
errorWithDomain
:
kShopifyError
code
:
BUYShopifyError_InvalidCheckoutObject
userInfo
:
nil
]);
...
@@ -651,15 +645,14 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
...
@@ -651,15 +645,14 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
return
task
;
return
task
;
}
}
-
(
NSURLSessionDataTask
*
)
postPaymentRequestWithCheckout
:
(
BUYCheckout
*
)
checkout
body
:
(
NSData
*
)
body
completion
:
(
void
(
^
)(
BUYCheckout
*
checkout
,
NSString
*
paymentSessionId
,
NSError
*
error
)
)
block
-
(
NSURLSessionDataTask
*
)
postPaymentRequestWithCheckout
:
(
BUYCheckout
*
)
checkout
body
:
(
NSData
*
)
body
completion
:
(
BUYDataCreditCardBlock
)
block
{
{
return
[
self
requestForURL
:
checkout
.
paymentURL
method
:
kPOST
body
:
body
completionHandler
:^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
requestForURL
:
checkout
.
paymentURL
method
:
kPOST
body
:
body
completionHandler
:^
(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
)
{
NSString
*
paymentSessionId
=
nil
;
id
<
BUYPaymentToken
>
token
=
nil
;
if
(
!
error
)
{
if
(
!
error
)
{
paymentSessionId
=
json
[
@"id"
];
token
=
[[
BUYCreditCardToken
alloc
]
initWithPaymentSessionID
:
json
[
@"id"
]];
checkout
.
paymentSessionId
=
paymentSessionId
;
}
}
block
(
checkout
,
paymentSessionId
,
error
);
block
(
checkout
,
token
,
error
);
}];
}];
}
}
...
...
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCardToken.m
View file @
1fc243ad
...
@@ -34,6 +34,8 @@
...
@@ -34,6 +34,8 @@
{
{
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
if
(
self
)
{
NSAssert
(
paymentSessionID
,
@"Failed to initialize BUYCreditCardToken. Invalid or nil payment session ID."
);
_paymentSessionID
=
paymentSessionID
;
_paymentSessionID
=
paymentSessionID
;
}
}
return
self
;
return
self
;
...
...
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Models/Mobile Buy SDK.xcdatamodeld/Mobile Buy SDK.xcdatamodel/contents
View file @
1fc243ad
...
@@ -157,11 +157,6 @@
...
@@ -157,11 +157,6 @@
<entry
key=
"documentation"
value=
"Amount of payment due on the checkout."
/>
<entry
key=
"documentation"
value=
"Amount of payment due on the checkout."
/>
</userInfo>
</userInfo>
</attribute>
</attribute>
<attribute
name=
"paymentSessionId"
optional=
"YES"
attributeType=
"String"
syncable=
"YES"
>
<userInfo>
<entry
key=
"documentation"
value=
"The Payment Session ID associated with a credit card transaction."
/>
</userInfo>
</attribute>
<attribute
name=
"paymentURL"
optional=
"YES"
attributeType=
"Transformable"
valueTransformerName=
""
syncable=
"YES"
>
<attribute
name=
"paymentURL"
optional=
"YES"
attributeType=
"Transformable"
valueTransformerName=
""
syncable=
"YES"
>
<userInfo>
<userInfo>
<entry
key=
"attributeValueClassName"
value=
"NSURL"
/>
<entry
key=
"attributeValueClassName"
value=
"NSURL"
/>
...
@@ -992,7 +987,7 @@
...
@@ -992,7 +987,7 @@
<element
name=
"Address"
positionX=
"126"
positionY=
"521"
width=
"128"
height=
"240"
/>
<element
name=
"Address"
positionX=
"126"
positionY=
"521"
width=
"128"
height=
"240"
/>
<element
name=
"Cart"
positionX=
"-576"
positionY=
"558"
width=
"128"
height=
"60"
/>
<element
name=
"Cart"
positionX=
"-576"
positionY=
"558"
width=
"128"
height=
"60"
/>
<element
name=
"CartLineItem"
positionX=
"-380"
positionY=
"558"
width=
"128"
height=
"90"
/>
<element
name=
"CartLineItem"
positionX=
"-380"
positionY=
"558"
width=
"128"
height=
"90"
/>
<element
name=
"Checkout"
positionX=
"333"
positionY=
"442"
width=
"128"
height=
"6
45
"
/>
<element
name=
"Checkout"
positionX=
"333"
positionY=
"442"
width=
"128"
height=
"6
30
"
/>
<element
name=
"CheckoutAttribute"
positionX=
"-954"
positionY=
"594"
width=
"128"
height=
"90"
/>
<element
name=
"CheckoutAttribute"
positionX=
"-954"
positionY=
"594"
width=
"128"
height=
"90"
/>
<element
name=
"Collection"
positionX=
"-963"
positionY=
"772"
width=
"128"
height=
"210"
/>
<element
name=
"Collection"
positionX=
"-963"
positionY=
"772"
width=
"128"
height=
"210"
/>
<element
name=
"Customer"
positionX=
"106"
positionY=
"1263"
width=
"128"
height=
"330"
/>
<element
name=
"Customer"
positionX=
"106"
positionY=
"1263"
width=
"128"
height=
"330"
/>
...
...
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/_BUYCheckout.h
View file @
1fc243ad
...
@@ -42,7 +42,6 @@ extern const struct BUYCheckoutAttributes {
...
@@ -42,7 +42,6 @@ extern const struct BUYCheckoutAttributes {
__unsafe_unretained
NSString
*
note
;
__unsafe_unretained
NSString
*
note
;
__unsafe_unretained
NSString
*
partialAddresses
;
__unsafe_unretained
NSString
*
partialAddresses
;
__unsafe_unretained
NSString
*
paymentDue
;
__unsafe_unretained
NSString
*
paymentDue
;
__unsafe_unretained
NSString
*
paymentSessionId
;
__unsafe_unretained
NSString
*
paymentURL
;
__unsafe_unretained
NSString
*
paymentURL
;
__unsafe_unretained
NSString
*
privacyPolicyURL
;
__unsafe_unretained
NSString
*
privacyPolicyURL
;
__unsafe_unretained
NSString
*
refundPolicyURL
;
__unsafe_unretained
NSString
*
refundPolicyURL
;
...
@@ -194,11 +193,6 @@ extern const struct BUYCheckoutUserInfo {
...
@@ -194,11 +193,6 @@ extern const struct BUYCheckoutUserInfo {
@property
(
nonatomic
,
strong
)
NSDecimalNumber
*
paymentDue
;
@property
(
nonatomic
,
strong
)
NSDecimalNumber
*
paymentDue
;
/**
/**
* The Payment Session ID associated with a credit card transaction.
*/
@property
(
nonatomic
,
strong
)
NSString
*
paymentSessionId
;
/**
* URL to the payment gateway.
* URL to the payment gateway.
*/
*/
@property
(
nonatomic
,
strong
)
NSURL
*
paymentURL
;
@property
(
nonatomic
,
strong
)
NSURL
*
paymentURL
;
...
...
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/_BUYCheckout.m
View file @
1fc243ad
...
@@ -40,7 +40,6 @@ const struct BUYCheckoutAttributes BUYCheckoutAttributes = {
...
@@ -40,7 +40,6 @@ const struct BUYCheckoutAttributes BUYCheckoutAttributes = {
.
note
=
@"note"
,
.
note
=
@"note"
,
.
partialAddresses
=
@"partialAddresses"
,
.
partialAddresses
=
@"partialAddresses"
,
.
paymentDue
=
@"paymentDue"
,
.
paymentDue
=
@"paymentDue"
,
.
paymentSessionId
=
@"paymentSessionId"
,
.
paymentURL
=
@"paymentURL"
,
.
paymentURL
=
@"paymentURL"
,
.
privacyPolicyURL
=
@"privacyPolicyURL"
,
.
privacyPolicyURL
=
@"privacyPolicyURL"
,
.
refundPolicyURL
=
@"refundPolicyURL"
,
.
refundPolicyURL
=
@"refundPolicyURL"
,
...
...
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