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
76b37ee0
Commit
76b37ee0
authored
Jan 19, 2016
by
Rune Madsen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #85 from Shopify/task/runmad.84-remove-shipping-rate-id
Remove shippingRateId on BUYCheckout
parents
41966c37
3211434a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
32 deletions
+8
-32
BUYCheckoutTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYCheckoutTest.m
+0
-13
BUYCheckout.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCheckout.h
+3
-3
BUYCheckout.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCheckout.m
+5
-16
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYCheckoutTest.m
View file @
76b37ee0
...
...
@@ -73,17 +73,6 @@
XCTAssertTrue
([
checkout
isDirty
]);
}
-
(
void
)
testSettingAShippingRateMarksShippingRateIdAsDirty
{
BUYShippingRate
*
shippingRate
=
[[
BUYShippingRate
alloc
]
initWithDictionary
:@{
@"id"
:
@"banana"
}];
XCTAssertNil
(
_checkout
.
shippingRate
);
XCTAssertNil
(
_checkout
.
shippingRateId
);
_checkout
.
shippingRate
=
shippingRate
;
XCTAssertEqualObjects
(
@"banana"
,
_checkout
.
shippingRateId
);
XCTAssertTrue
([[
_checkout
dirtyProperties
]
containsObject
:
@"shippingRateId"
]);
}
-
(
void
)
testDirtyPropertiesAreReturnedInJSON
{
BUYShippingRate
*
shippingRate
=
[[
BUYShippingRate
alloc
]
initWithDictionary
:@{
@"id"
:
@"banana"
}];
...
...
@@ -93,12 +82,10 @@
_checkout
.
currency
=
@"BANANA"
;
NSSet
*
dirtyProperties
=
[
_checkout
dirtyProperties
];
XCTAssertTrue
([
dirtyProperties
containsObject
:
@"currency"
]);
XCTAssertTrue
([
dirtyProperties
containsObject
:
@"shippingRateId"
]);
XCTAssertTrue
([
dirtyProperties
containsObject
:
@"shippingRate"
]);
NSDictionary
*
json
=
[
_checkout
jsonDictionaryForCheckout
];
XCTAssertEqualObjects
(
json
[
@"checkout"
][
@"currency"
],
@"BANANA"
);
XCTAssertEqualObjects
(
json
[
@"checkout"
][
@"shipping_rate_id"
],
@"banana"
);
}
-
(
void
)
testRequiresShippingAndIncludesTaxesSerialization
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCheckout.h
View file @
76b37ee0
...
...
@@ -149,9 +149,9 @@
@property
(
nonatomic
,
strong
)
BUYShippingRate
*
shippingRate
;
/**
* Shipping rate identifier
*/
@property
(
nonatomic
,
readonly
)
NSString
*
shippingRateId
;
* Shipping rate identifier
*/
@property
(
nonatomic
,
readonly
)
NSString
*
shippingRateId
DEPRECATED_MSG_ATTRIBUTE
(
"Use shippingRate.shippingRateIdentifier"
)
;
/**
* A discount added to the checkout
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCheckout.m
View file @
76b37ee0
...
...
@@ -71,22 +71,6 @@
return
self
;
}
-
(
void
)
setShippingRateId
:
(
NSString
*
)
shippingRateIdentifier
{
[
self
willChangeValueForKey
:
@"shippingRateId"
];
_shippingRateId
=
shippingRateIdentifier
;
[
self
didChangeValueForKey
:
@"shippingRateId"
];
}
-
(
void
)
setShippingRate
:
(
BUYShippingRate
*
)
shippingRate
{
[
self
willChangeValueForKey
:
@"shippingRate"
];
_shippingRate
=
shippingRate
;
[
self
didChangeValueForKey
:
@"shippingRate"
];
[
self
setShippingRateId
:
shippingRate
.
shippingRateIdentifier
];
}
+
(
NSString
*
)
jsonKeyForProperty
:
(
NSString
*
)
property
{
NSString
*
key
=
nil
;
...
...
@@ -171,6 +155,11 @@
self
.
sourceIdentifier
=
dictionary
[
@"source_identifier"
];
}
-
(
NSString
*
)
shippingRateId
{
return
self
.
shippingRate
.
shippingRateIdentifier
;
}
-
(
id
)
jsonValueForValue
:
(
id
)
value
{
id
newValue
=
value
;
...
...
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