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
2ebce1d6
Commit
2ebce1d6
authored
Dec 13, 2016
by
HouWeiBin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,第二次尝试修改订单 使dictionary能拿到(第一次修改的结果导致配送费无法正常使用)
parent
461a6636
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
BUYClient+Checkout.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.h
+1
-1
BUYClient+Checkout.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.m
+14
-4
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.h
View file @
2ebce1d6
...
@@ -49,7 +49,7 @@ typedef void (^BUYDataCreditCardBlock)(id<BUYPaymentToken> _Nullable paymentToke
...
@@ -49,7 +49,7 @@ typedef void (^BUYDataCreditCardBlock)(id<BUYPaymentToken> _Nullable paymentToke
* @param checkout The returned BUYCheckout
* @param checkout The returned BUYCheckout
* @param error Optional NSError
* @param error Optional NSError
*/
*/
typedef
void
(
^
BUYDataCheckoutBlock
)(
BUYCheckout
*
_Nullable
checkout
,
NSError
*
_Nullable
error
);
typedef
void
(
^
BUYDataCheckoutBlock
)(
NSDictionary
*
_Nullable
dictionary
,
BUYCheckout
*
_Nullable
checkout
,
NSError
*
_Nullable
error
);
/**
/**
* Return block containing BUYShippingRate objects, a BUYStatus and/or an NSError
* Return block containing BUYShippingRate objects, a BUYStatus and/or an NSError
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Checkout.m
View file @
2ebce1d6
...
@@ -182,11 +182,12 @@
...
@@ -182,11 +182,12 @@
-
(
void
)
handleCheckoutResponse
:(
NSDictionary
*
)
json
error
:(
NSError
*
)
error
block
:(
BUYDataCheckoutBlock
)
block
-
(
void
)
handleCheckoutResponse
:(
NSDictionary
*
)
json
error
:(
NSError
*
)
error
block
:(
BUYDataCheckoutBlock
)
block
{
{
BUYCheckout
*
checkout
=
nil
;
BUYCheckout
*
checkout
=
nil
;
NSDictionary
*
dictionary
=
nil
;
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
checkout
=
[
self
.
modelManager
insertCheckoutWithJSONDictionary
:
json
[
@"checkout"
]];
checkout
=
[
self
.
modelManager
insertCheckoutWithJSONDictionary
:
json
[
@"checkout"
]];
checkout
.
JSOND
ictionary
=
json
[
@"checkout"
];
d
ictionary
=
json
[
@"checkout"
];
}
}
block
(
checkout
,
error
);
block
(
dictionary
,
checkout
,
error
);
}
}
#pragma mark - Shipping Rates -
#pragma mark - Shipping Rates -
...
@@ -248,6 +249,9 @@
...
@@ -248,6 +249,9 @@
NSURL
*
route
=
[
self
urlForCheckoutsUsingGiftCardWithToken
:
checkout
.
token
];
NSURL
*
route
=
[
self
urlForCheckoutsUsingGiftCardWithToken
:
checkout
.
token
];
return
[
self
postRequestForURL
:
route
object
:
giftCard
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
postRequestForURL
:
route
object
:
giftCard
completionHandler
:^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
NSDictionary
*
dictionary
=
nil
;
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
NSDictionary
*
giftCardJSON
=
json
[
@"gift_card"
];
NSDictionary
*
giftCardJSON
=
json
[
@"gift_card"
];
...
@@ -259,10 +263,12 @@
...
@@ -259,10 +263,12 @@
* 'paymentDue' value and the gift
* 'paymentDue' value and the gift
* card.
* card.
*/
*/
dictionary
=
giftCardJSON
[
@"checkout"
];
checkout
.
JSONDictionary
=
giftCardJSON
[
@"checkout"
];
checkout
.
JSONDictionary
=
giftCardJSON
[
@"checkout"
];
[
checkout
addGiftCard
:
giftCard
];
[
checkout
addGiftCard
:
giftCard
];
}
}
block
(
checkout
,
error
);
block
(
dictionary
,
checkout
,
error
);
}];
}];
}
}
...
@@ -273,6 +279,9 @@
...
@@ -273,6 +279,9 @@
NSURL
*
route
=
[
self
urlForCheckoutsUsingGiftCard
:
giftCard
.
identifier
token
:
checkout
.
token
];
NSURL
*
route
=
[
self
urlForCheckoutsUsingGiftCard
:
giftCard
.
identifier
token
:
checkout
.
token
];
return
[
self
deleteRequestForURL
:
route
completionHandler
:
^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
return
[
self
deleteRequestForURL
:
route
completionHandler
:
^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
NSDictionary
*
dictionary
=
nil
;
if
(
json
&&
!
error
)
{
if
(
json
&&
!
error
)
{
NSDictionary
*
giftCardJSON
=
json
[
@"gift_card"
];
NSDictionary
*
giftCardJSON
=
json
[
@"gift_card"
];
...
@@ -284,10 +293,11 @@
...
@@ -284,10 +293,11 @@
* 'paymentDue' value and the gift
* 'paymentDue' value and the gift
* card.
* card.
*/
*/
dictionary
=
giftCardJSON
[
@"checkout"
];
checkout
.
JSONDictionary
=
giftCardJSON
[
@"checkout"
];
checkout
.
JSONDictionary
=
giftCardJSON
[
@"checkout"
];
[
checkout
removeGiftCardWithIdentifier
:
giftCardID
];
[
checkout
removeGiftCardWithIdentifier
:
giftCardID
];
}
}
block
(
checkout
,
error
);
block
(
dictionary
,
checkout
,
error
);
}];
}];
}
}
...
...
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