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
fe599067
Commit
fe599067
authored
Jun 08, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #224 from Shopify/task/nullability
Add nullability annotations
parents
40120666
8b151644
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
199 additions
and
103 deletions
+199
-103
BUYApplePayAdditionsTest.m
...e Buy SDK/Mobile Buy SDK Tests/BUYApplePayAdditionsTest.m
+1
-1
BUYIntegrationTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
+1
-1
BUYLineItemTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYLineItemTest.m
+1
-1
BUYObjectTests.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
+1
-1
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+4
-0
BUYAccountCredentials.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAccountCredentials.h
+1
-2
BUYCreditCard.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCard.h
+8
-5
BUYError.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.h
+7
-5
BUYError.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.m
+1
-1
BUYManagedObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
+8
-6
BUYModelManager.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
+3
-1
BUYModelManagerProtocol.h
...e Buy SDK/Mobile Buy SDK/Models/BUYModelManagerProtocol.h
+6
-3
BUYObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
+4
-2
BUYObjectProtocol.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObjectProtocol.h
+7
-4
BUYPaymentToken.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYPaymentToken.h
+4
-0
BUYSerializable.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.h
+4
-2
BUYAddress.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYAddress.h
+3
-0
BUYCart.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.h
+7
-4
BUYCart.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.m
+2
-2
BUYCartLineItem.h
...uy SDK/Mobile Buy SDK/Models/Persistent/BUYCartLineItem.h
+4
-3
BUYCollection.h
... Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.h
+4
-1
BUYCollection.m
... Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.m
+1
-1
BUYCustomer.h
...le Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCustomer.h
+4
-1
BUYImageLink.h
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.h
+4
-2
BUYImageLink.m
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.m
+7
-31
BUYLineItem.h
...le Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.h
+6
-3
BUYLineItem.m
...le Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.m
+0
-1
BUYOption.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOption.h
+3
-0
BUYOptionValue.h
...Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOptionValue.h
+4
-1
BUYOrder.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.h
+3
-0
BUYOrder.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.m
+1
-1
BUYProduct.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
+5
-1
BUYProduct.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
+3
-3
BUYProductVariant.h
... SDK/Mobile Buy SDK/Models/Persistent/BUYProductVariant.h
+4
-1
BUYShop.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.h
+3
-0
BUYCheckout.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.h
+4
-2
BUYCheckout.m
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
+2
-2
BUYCheckoutAttribute.h
...DK/Mobile Buy SDK/Models/Transient/BUYCheckoutAttribute.h
+4
-0
BUYDiscount.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYDiscount.h
+6
-1
BUYGiftCard.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYGiftCard.h
+3
-0
BUYMaskedCreditCard.h
...SDK/Mobile Buy SDK/Models/Transient/BUYMaskedCreditCard.h
+3
-0
BUYShippingRate.h
...Buy SDK/Mobile Buy SDK/Models/Transient/BUYShippingRate.h
+3
-0
BUYTaxLine.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYTaxLine.h
+3
-0
BUYApplePayAdditions.h
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAdditions.h
+6
-3
BUYError+BUYAdditions.h
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYError+BUYAdditions.h
+9
-1
BUYModelManager+ApplePay.h
...e Buy SDK/Mobile Buy SDK/Utils/BUYModelManager+ApplePay.h
+5
-3
BUYDateTransformer.h
...DK/Mobile Buy SDK/Value Transformers/BUYDateTransformer.h
+5
-0
BUYDecimalNumberTransformer.h
... Buy SDK/Value Transformers/BUYDecimalNumberTransformer.h
+4
-0
BUYDeliveryRangeTransformer.h
... Buy SDK/Value Transformers/BUYDeliveryRangeTransformer.h
+3
-0
BUYFlatCollectionTransformer.h
...Buy SDK/Value Transformers/BUYFlatCollectionTransformer.h
+3
-0
BUYIdentityTransformer.h
...obile Buy SDK/Value Transformers/BUYIdentityTransformer.h
+3
-0
BUYURLTransformer.h
...SDK/Mobile Buy SDK/Value Transformers/BUYURLTransformer.h
+4
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYApplePayAdditionsTest.m
View file @
fe599067
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
-
(
void
)
setUp
-
(
void
)
setUp
{
{
_modelManager
=
[
BUYModelManager
modelManager
];
_modelManager
=
[
BUYModelManager
modelManager
];
_checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
nil
];
_checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
[
BUYCart
new
]
];
}
}
-
(
void
)
tearDown
-
(
void
)
tearDown
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
View file @
fe599067
...
@@ -766,7 +766,7 @@
...
@@ -766,7 +766,7 @@
{
{
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testFetchingShippingRatesWithInvalidCheckout_1"
useMocks
:[
self
shouldUseMocks
]];
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testFetchingShippingRatesWithInvalidCheckout_1"
useMocks
:[
self
shouldUseMocks
]];
BUYCheckout
*
checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
nil
];
BUYCheckout
*
checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
[
BUYCart
new
]
];
checkout
.
token
=
@"bananaaaa"
;
checkout
.
token
=
@"bananaaaa"
;
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYLineItemTest.m
View file @
fe599067
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
-
(
void
)
testJsonDictionaryDoesntIncludeVariantsWithoutIds
-
(
void
)
testJsonDictionaryDoesntIncludeVariantsWithoutIds
{
{
_lineItem
=
[
_modelManager
lineItemWithVariant
:
nil
];
_lineItem
=
[
_modelManager
lineItemWithVariant
:
[
BUYProductVariant
new
]
];
NSDictionary
*
json
=
[
_lineItem
jsonDictionaryForCheckout
];
NSDictionary
*
json
=
[
_lineItem
jsonDictionaryForCheckout
];
XCTAssertNotNil
(
json
);
XCTAssertNotNil
(
json
);
XCTAssertNil
(
json
[
@"variant_id"
]);
XCTAssertNil
(
json
[
@"variant_id"
]);
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
View file @
fe599067
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
-
(
BUYDirtyTracked
*
)
dirtyTrackedObject
-
(
BUYDirtyTracked
*
)
dirtyTrackedObject
{
{
return
[[
BUYDirtyTracked
alloc
]
initWithModelManager
:
nil
JSONDictionary
:
nil
];
return
[[
BUYDirtyTracked
alloc
]
initWithModelManager
:
[
BUYModelManager
modelManager
]
JSONDictionary
:
nil
];
}
}
@end
@end
...
...
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
fe599067
...
@@ -1487,6 +1487,7 @@
...
@@ -1487,6 +1487,7 @@
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
MACH_O_TYPE
=
mh_dylib
;
MACH_O_TYPE
=
mh_dylib
;
MODULEMAP_FILE
=
""
;
MODULEMAP_FILE
=
""
;
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
=
YES
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
...
@@ -1515,6 +1516,7 @@
...
@@ -1515,6 +1516,7 @@
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
MACH_O_TYPE
=
mh_dylib
;
MACH_O_TYPE
=
mh_dylib
;
MODULEMAP_FILE
=
""
;
MODULEMAP_FILE
=
""
;
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
=
YES
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
...
@@ -1733,6 +1735,7 @@
...
@@ -1733,6 +1735,7 @@
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
MACH_O_TYPE
=
mh_dylib
;
MACH_O_TYPE
=
mh_dylib
;
MODULEMAP_FILE
=
""
;
MODULEMAP_FILE
=
""
;
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
=
YES
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
...
@@ -1847,6 +1850,7 @@
...
@@ -1847,6 +1850,7 @@
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
;
MACH_O_TYPE
=
mh_dylib
;
MACH_O_TYPE
=
mh_dylib
;
MODULEMAP_FILE
=
""
;
MODULEMAP_FILE
=
""
;
MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
=
YES
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_BUNDLE_IDENTIFIER
=
"com.shopify.$(PRODUCT_NAME:rfc1034identifier)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAccountCredentials.h
View file @
fe599067
...
@@ -73,4 +73,4 @@ OBJC_EXTERN NSString * const BUYAccountPasswordConfirmationKey;
...
@@ -73,4 +73,4 @@ OBJC_EXTERN NSString * const BUYAccountPasswordConfirmationKey;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
\ No newline at end of file
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCard.h
View file @
fe599067
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
@import
Foundation
;
@import
Foundation
;
#import <Buy/BUYSerializable.h>
#import <Buy/BUYSerializable.h>
NS_ASSUME_NONNULL_BEGIN
/**
/**
* This represents raw credit card data that the user is posting. You MUST discard this object as soon as it has been posted
* This represents raw credit card data that the user is posting. You MUST discard this object as soon as it has been posted
...
@@ -37,27 +38,29 @@
...
@@ -37,27 +38,29 @@
* The full name on the credit card
* The full name on the credit card
* First and Last in this format: 'First Last'.
* First and Last in this format: 'First Last'.
*/
*/
@property
(
nonatomic
,
copy
)
NSString
*
nameOnCard
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
nameOnCard
;
/**
/**
* The full credit card number.
* The full credit card number.
* This should be a numerical value without spaces, dashes or any other special characters.
* This should be a numerical value without spaces, dashes or any other special characters.
*/
*/
@property
(
nonatomic
,
copy
)
NSString
*
number
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
number
;
/**
/**
* The month that the credit card expires, as a numerical value (i.e. 12 for December).
* The month that the credit card expires, as a numerical value (i.e. 12 for December).
*/
*/
@property
(
nonatomic
,
copy
)
NSString
*
expiryMonth
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
expiryMonth
;
/**
/**
* The last two digits of the year in which the credit card expires (i.e. 18 for 2018).
* The last two digits of the year in which the credit card expires (i.e. 18 for 2018).
*/
*/
@property
(
nonatomic
,
copy
)
NSString
*
expiryYear
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
expiryYear
;
/**
/**
* The Card Verification Value number (or whichever card security code should be used for the card type).
* The Card Verification Value number (or whichever card security code should be used for the card type).
*/
*/
@property
(
nonatomic
,
copy
)
NSString
*
cvv
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
cvv
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.h
View file @
fe599067
...
@@ -25,15 +25,17 @@
...
@@ -25,15 +25,17 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYError
:
NSObject
@interface
BUYError
:
NSObject
@property
(
nonatomic
,
copy
)
NSString
*
key
;
@property
(
nonatomic
,
nonnull
,
copy
,
readonly
)
NSString
*
key
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSString
*
code
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSString
*
message
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSDictionary
<
NSString
*
,
NSString
*>
*
options
;
-
(
instancetype
)
initWithKey
:(
NSString
*
)
key
json
:(
NSDictionary
*
)
json
;
-
(
instancetype
)
initWithKey
:(
NSString
*
)
key
json
:(
NSDictionary
*
)
json
;
@property
(
nonatomic
,
copy
)
NSString
*
code
;
@property
(
nonatomic
,
copy
)
NSString
*
message
;
@property
(
nonatomic
,
copy
)
NSDictionary
<
NSString
*
,
NSString
*>
*
options
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.m
View file @
fe599067
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
{
{
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
if
(
self
)
{
self
.
key
=
key
;
_key
=
[
key
copy
]
;
[
self
setValuesForKeysWithDictionary
:
json
];
[
self
setValuesForKeysWithDictionary
:
json
];
}
}
return
self
;
return
self
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
View file @
fe599067
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
//
//
#import <CoreData/CoreData.h>
#import <CoreData/CoreData.h>
#import <Buy/BUYObject.h>
#import <Buy/BUYObject.h>
NS_ASSUME_NONNULL_BEGIN
#if defined CORE_DATA_PERSISTENCE
#if defined CORE_DATA_PERSISTENCE
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
@interface
BUYManagedObject
:
NSManagedObject
<
BUYObject
>
@interface
BUYManagedObject
:
NSManagedObject
<
BUYObject
>
-
(
nonnull
instancetype
)
init
NS_UNAVAILABLE
;
-
(
instancetype
)
init
NS_UNAVAILABLE
;
@end
@end
...
@@ -56,11 +56,13 @@
...
@@ -56,11 +56,13 @@
*/
*/
@interface
BUYObject
(
BUYManagedObjectConformance
)
@interface
BUYObject
(
BUYManagedObjectConformance
)
-
(
void
)
willAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
willAccessValueForKey
:(
NSString
*
)
key
;
-
(
void
)
didAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
didAccessValueForKey
:(
NSString
*
)
key
;
-
(
nullable
id
)
primitiveValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
nullable
id
)
primitiveValueForKey
:(
NSString
*
)
key
;
-
(
void
)
setPrimitiveValue
:(
nullable
id
)
value
forKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
setPrimitiveValue
:(
nullable
id
)
value
forKey
:(
NSString
*
)
key
;
@end
@end
#endif
#endif
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
View file @
fe599067
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <Buy/BUYObject.h>
#import <Buy/BUYObject.h>
#import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
NS_ASSUME_NONNULL_BEGIN
/**
/**
* A basic implementation of the BUYModelManager interface that does no caching. New objects are created using alloc/init.
* A basic implementation of the BUYModelManager interface that does no caching. New objects are created using alloc/init.
...
@@ -54,3 +54,5 @@
...
@@ -54,3 +54,5 @@
+
(
instancetype
)
modelManager
;
+
(
instancetype
)
modelManager
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManagerProtocol.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <CoreData/CoreData.h>
#import <CoreData/CoreData.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYObject
;
@protocol
BUYObject
;
...
@@ -52,7 +53,7 @@
...
@@ -52,7 +53,7 @@
*
*
* @return A new or existing model object.
* @return A new or existing model object.
*/
*/
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
JSONDictionary
:(
NSDictionary
*
)
JSON
;
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
JSONDictionary
:(
nullable
NSDictionary
*
)
JSON
;
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
JSONArray
:(
NSArray
*
)
JSON
;
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
JSONArray
:(
NSArray
*
)
JSON
;
/**
/**
...
@@ -64,7 +65,7 @@
...
@@ -64,7 +65,7 @@
*
*
* @return An object from the cache matching the provided identifier, or nil if no matching object is found.
* @return An object from the cache matching the provided identifier, or nil if no matching object is found.
*/
*/
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
identifier
:(
NSNumber
*
)
identifier
;
-
(
nullable
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
identifier
:(
NSNumber
*
)
identifier
;
/**
/**
* Find all the objects in the cache matching the provided identifiers.
* Find all the objects in the cache matching the provided identifiers.
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
*
*
* @return An array of objects from the cache matching the provided identifiers, if any.
* @return An array of objects from the cache matching the provided identifiers, if any.
*/
*/
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
identifiers
:(
NSArray
*
)
identifiers
;
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
identifiers
:(
nullable
NSArray
*
)
identifiers
;
/**
/**
* If there is a local cache available, and the object is cached, it is flushed from the cache. Depending on the type of
* If there is a local cache available, and the object is cached, it is flushed from the cache. Depending on the type of
...
@@ -109,3 +110,5 @@
...
@@ -109,3 +110,5 @@
-
(
BOOL
)
buy_purgeObjectsWithEntityName
:(
NSString
*
)
entityName
matchingPredicate
:(
NSPredicate
*
)
predicate
;
-
(
BOOL
)
buy_purgeObjectsWithEntityName
:(
NSString
*
)
entityName
matchingPredicate
:(
NSPredicate
*
)
predicate
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
View file @
fe599067
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYObject
:
NSObject
<
BUYObject
>
@interface
BUYObject
:
NSObject
<
BUYObject
>
...
@@ -37,8 +37,10 @@
...
@@ -37,8 +37,10 @@
*/
*/
@property
(
nonatomic
,
readonly
,
getter
=
isDirty
)
BOOL
dirty
;
@property
(
nonatomic
,
readonly
,
getter
=
isDirty
)
BOOL
dirty
;
-
(
NSSet
*
)
dirtyProperties
;
-
(
nullable
NSSet
*
)
dirtyProperties
;
-
(
void
)
markPropertyAsDirty
:(
NSString
*
)
property
;
-
(
void
)
markPropertyAsDirty
:(
NSString
*
)
property
;
-
(
void
)
markAsClean
;
-
(
void
)
markAsClean
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObjectProtocol.h
View file @
fe599067
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <Buy/BUYSerializable.h>
#import <Buy/BUYSerializable.h>
NS_ASSUME_NONNULL_BEGIN
@class
NSEntityDescription
;
@class
NSEntityDescription
;
...
@@ -37,12 +38,12 @@
...
@@ -37,12 +38,12 @@
*/
*/
@protocol
BUYObject
<
BUYSerializable
>
@protocol
BUYObject
<
BUYSerializable
>
@property
(
nonatomic
,
readonly
,
weak
)
id
<
BUYModelManager
>
modelManager
;
@property
(
nonatomic
,
readonly
,
nullable
,
weak
)
id
<
BUYModelManager
>
modelManager
;
/**
/**
* Transient model objects need an entity for introspection.
* Transient model objects need an entity for introspection.
*/
*/
@property
(
nonatomic
,
readonly
,
weak
)
NSEntityDescription
*
entity
;
@property
(
nonatomic
,
readonly
,
nullable
,
weak
)
NSEntityDescription
*
entity
;
/**
/**
* A dictionary of @{ NSString : NSPropertyDescription } where the keys are property names.
* A dictionary of @{ NSString : NSPropertyDescription } where the keys are property names.
...
@@ -63,7 +64,7 @@
...
@@ -63,7 +64,7 @@
/**
/**
* A predicate composed of values from the JSON. For objects that do not have an "identifier"/"id" property.
* A predicate composed of values from the JSON. For objects that do not have an "identifier"/"id" property.
*/
*/
+
(
NSPredicate
*
)
fetchPredicateWithJSON
:(
NSDictionary
*
)
JSONDictionary
;
+
(
nullable
NSPredicate
*
)
fetchPredicateWithJSON
:(
NSDictionary
*
)
JSONDictionary
;
/**
/**
* Persistent classes return YES; transient classes return NO.
* Persistent classes return YES; transient classes return NO.
...
@@ -77,6 +78,8 @@
...
@@ -77,6 +78,8 @@
@optional
@optional
-
(
instancetype
)
initWithModelManager
:
(
id
<
BUYModelManager
>
)
modelManager
JSONDictionary
:
(
NSDictionary
*
)
dictionary
;
-
(
instancetype
)
initWithModelManager
:
(
id
<
BUYModelManager
>
)
modelManager
JSONDictionary
:
(
nullable
NSDictionary
*
)
dictionary
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYPaymentToken.h
View file @
fe599067
...
@@ -24,8 +24,12 @@
...
@@ -24,8 +24,12 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYPaymentToken
<
NSObject
>
@protocol
BUYPaymentToken
<
NSObject
>
-
(
NSDictionary
*
)
JSONDictionary
;
-
(
NSDictionary
*
)
JSONDictionary
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYSerializable
<
NSObject
>
@protocol
BUYSerializable
<
NSObject
>
...
@@ -34,4 +35,6 @@
...
@@ -34,4 +35,6 @@
@interface
NSDictionary
(
BUYSerializable
)
<
BUYSerializable
>
@interface
NSDictionary
(
BUYSerializable
)
<
BUYSerializable
>
@end
@end
\ No newline at end of file
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYAddress.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Buy/_BUYAddress.h>
#import <Buy/_BUYAddress.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYAddress
:
_BUYAddress
{}
@interface
BUYAddress
:
_BUYAddress
{}
...
@@ -47,3 +48,5 @@
...
@@ -47,3 +48,5 @@
-
(
BOOL
)
isValidAddressForShippingRates
;
-
(
BOOL
)
isValidAddressForShippingRates
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Buy/_BUYCart.h>
#import <Buy/_BUYCart.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYProductVariant
;
@class
BUYProductVariant
;
@class
BUYLineItem
;
@class
BUYLineItem
;
...
@@ -36,7 +37,7 @@
...
@@ -36,7 +37,7 @@
*
*
* These are different from BUYLineItem objects. The line item objects do include the BUYProductVariant.
* These are different from BUYLineItem objects. The line item objects do include the BUYProductVariant.
*/
*/
-
(
nonnull
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
;
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
;
/**
/**
* Returns true if the cart is acceptable to send to Shopify.
* Returns true if the cart is acceptable to send to Shopify.
...
@@ -56,7 +57,7 @@
...
@@ -56,7 +57,7 @@
*
*
* @param variant The BUYProductVariant to add to the BUYCart or increase by one quantity
* @param variant The BUYProductVariant to add to the BUYCart or increase by one quantity
*/
*/
-
(
void
)
addVariant
:(
nonnull
BUYProductVariant
*
)
variant
;
-
(
void
)
addVariant
:(
BUYProductVariant
*
)
variant
;
/**
/**
* Removes the BUYCartLineItem from the BUYCart associated with the given BUYProductVariant object.
* Removes the BUYCartLineItem from the BUYCart associated with the given BUYProductVariant object.
...
@@ -64,7 +65,7 @@
...
@@ -64,7 +65,7 @@
*
*
* @param variant The BUYProductVariant to remove from the BUYCart or decrease by one quantity
* @param variant The BUYProductVariant to remove from the BUYCart or decrease by one quantity
*/
*/
-
(
void
)
removeVariant
:(
nonnull
BUYProductVariant
*
)
variant
;
-
(
void
)
removeVariant
:(
BUYProductVariant
*
)
variant
;
/**
/**
* Adds a BUYCartLineItem with a set quantity to the BUYCart with the given BUYProductVariant object on it.
* Adds a BUYCartLineItem with a set quantity to the BUYCart with the given BUYProductVariant object on it.
...
@@ -74,6 +75,8 @@
...
@@ -74,6 +75,8 @@
* @param variant The BUYProductVariant to add to the BUYCart with a quantity
* @param variant The BUYProductVariant to add to the BUYCart with a quantity
* @param quantity The quantity for the BUYCartLineItem associated with the BUYProductVariant
* @param quantity The quantity for the BUYCartLineItem associated with the BUYProductVariant
*/
*/
-
(
void
)
setVariant
:(
nonnull
BUYProductVariant
*
)
variant
withTotalQuantity
:(
NSInteger
)
quantity
;
-
(
void
)
setVariant
:(
BUYProductVariant
*
)
variant
withTotalQuantity
:(
NSInteger
)
quantity
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.m
View file @
fe599067
...
@@ -42,9 +42,9 @@
...
@@ -42,9 +42,9 @@
}
}
#endif
#endif
-
(
nonnull
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
{
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
}
-
(
BOOL
)
isValid
-
(
BOOL
)
isValid
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCartLineItem.h
View file @
fe599067
...
@@ -25,11 +25,11 @@
...
@@ -25,11 +25,11 @@
//
//
#import <Buy/_BUYCartLineItem.h>
#import <Buy/_BUYCartLineItem.h>
NS_ASSUME_NONNULL_BEGIN
/**
/**
* Newly inserted `CartLineItem`s have an initial quantity of 1.
* Newly inserted `CartLineItem`s have an initial quantity of 1.
*/
*/
@interface
BUYCartLineItem
:
_BUYCartLineItem
{}
@interface
BUYCartLineItem
:
_BUYCartLineItem
{}
/**
/**
...
@@ -68,4 +68,6 @@
...
@@ -68,4 +68,6 @@
-
(
BUYCartLineItem
*
)
cartLineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
-
(
BUYCartLineItem
*
)
cartLineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
@end
@end
\ No newline at end of file
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.h
View file @
fe599067
...
@@ -26,10 +26,11 @@
...
@@ -26,10 +26,11 @@
#import <Buy/_BUYCollection.h>
#import <Buy/_BUYCollection.h>
#import <Buy/BUYClient+Storefront.h>
#import <Buy/BUYClient+Storefront.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYCollection
:
_BUYCollection
{}
@interface
BUYCollection
:
_BUYCollection
{}
@property
(
nonatomic
,
readonly
)
NSString
*
stringDescription
;
@property
(
nonatomic
,
nullable
,
readonly
)
NSString
*
stringDescription
;
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
;
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
;
...
@@ -43,3 +44,5 @@
...
@@ -43,3 +44,5 @@
+
(
NSString
*
)
sortOrderParameterForCollectionSort
:(
BUYCollectionSort
)
sort
;
+
(
NSString
*
)
sortOrderParameterForCollectionSort
:(
BUYCollectionSort
)
sort
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.m
View file @
fe599067
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
{
{
return
self
.
products
.
array
;
return
self
.
products
.
array
?:
@[]
;
}
}
-
(
void
)
updateStringDescription
-
(
void
)
updateStringDescription
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCustomer.h
View file @
fe599067
...
@@ -25,10 +25,11 @@
...
@@ -25,10 +25,11 @@
//
//
#import <Buy/_BUYCustomer.h>
#import <Buy/_BUYCustomer.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYCustomer
:
_BUYCustomer
{}
@interface
BUYCustomer
:
_BUYCustomer
{}
@property
(
readonly
)
NSString
*
fullName
;
@property
(
nonatomic
,
strong
,
readonly
)
NSString
*
fullName
;
@end
@end
...
@@ -37,3 +38,5 @@
...
@@ -37,3 +38,5 @@
-
(
BUYCustomer
*
)
customerWithJSONDictionary
:(
NSDictionary
*
)
json
;
-
(
BUYCustomer
*
)
customerWithJSONDictionary
:(
NSDictionary
*
)
json
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.h
View file @
fe599067
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
#import <Buy/_BUYImageLink.h>
@import
UIKit
;
@import
UIKit
;
#import <Buy/_BUYImageLink.h>
NS_ASSUME_NONNULL_BEGIN
// Defines for common maximum image sizes
// Defines for common maximum image sizes
typedef
NS_ENUM
(
NSUInteger
,
BUYImageURLSize
)
{
typedef
NS_ENUM
(
NSUInteger
,
BUYImageURLSize
)
{
...
@@ -83,3 +83,5 @@ typedef NS_ENUM(NSUInteger, BUYImageURLSize) {
...
@@ -83,3 +83,5 @@ typedef NS_ENUM(NSUInteger, BUYImageURLSize) {
-
(
BUYImageURLSize
)
buy_imageSize
;
-
(
BUYImageURLSize
)
buy_imageSize
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.m
View file @
fe599067
...
@@ -51,39 +51,15 @@
...
@@ -51,39 +51,15 @@
+
(
NSString
*
)
keyForImageSize
:(
BUYImageURLSize
)
size
+
(
NSString
*
)
keyForImageSize
:(
BUYImageURLSize
)
size
{
{
NSString
*
sizeKey
=
nil
;
switch
(
size
)
{
switch
(
size
)
{
case
BUYImageURLSize100x100
:
case
BUYImageURLSize100x100
:
return
@"_small"
;
sizeKey
=
@"_small"
;
case
BUYImageURLSize160x160
:
return
@"_compact"
;
break
;
case
BUYImageURLSize240x240
:
return
@"_medium"
;
case
BUYImageURLSize480x480
:
return
@"_large"
;
case
BUYImageURLSize160x160
:
case
BUYImageURLSize600x600
:
return
@"_grande"
;
sizeKey
=
@"_compact"
;
case
BUYImageURLSize1024x1024
:
return
@"_1024x1024"
;
break
;
case
BUYImageURLSize2048x2048
:
return
@"_2048x2048"
;
case
BUYImageURLSize240x240
:
sizeKey
=
@"_medium"
;
break
;
case
BUYImageURLSize480x480
:
sizeKey
=
@"_large"
;
break
;
case
BUYImageURLSize600x600
:
sizeKey
=
@"_grande"
;
break
;
case
BUYImageURLSize1024x1024
:
sizeKey
=
@"_1024x1024"
;
break
;
case
BUYImageURLSize2048x2048
:
sizeKey
=
@"_2048x2048"
;
break
;
}
}
return
sizeKey
;
}
}
@end
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.h
View file @
fe599067
...
@@ -26,8 +26,11 @@
...
@@ -26,8 +26,11 @@
#import <Buy/_BUYLineItem.h>
#import <Buy/_BUYLineItem.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManager.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYCartLineItem
,
BUYProductVariant
;
@class
BUYCartLineItem
;
@class
BUYProductVariant
;
@class
BUYCartLineItem
;
@interface
BUYLineItem
:
_BUYLineItem
{}
@interface
BUYLineItem
:
_BUYLineItem
{}
...
@@ -36,11 +39,11 @@
...
@@ -36,11 +39,11 @@
@end
@end
@class
BUYCartLineItem
;
@interface
BUYModelManager
(
BUYLineItemCreation
)
@interface
BUYModelManager
(
BUYLineItemCreation
)
-
(
BUYLineItem
*
)
lineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
-
(
BUYLineItem
*
)
lineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
-
(
BUYLineItem
*
)
lineItemWithCartLineItem
:(
BUYCartLineItem
*
)
cartLineItem
;
-
(
BUYLineItem
*
)
lineItemWithCartLineItem
:(
BUYCartLineItem
*
)
cartLineItem
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.m
View file @
fe599067
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
//
//
#import "BUYLineItem.h"
#import "BUYLineItem.h"
#import "BUYCartLineItem.h"
#import "BUYCartLineItem.h"
#import "BUYProductVariant.h"
#import "BUYProductVariant.h"
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOption.h
View file @
fe599067
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
//
//
#import <Buy/_BUYOption.h>
#import <Buy/_BUYOption.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOption
:
_BUYOption
{}
@interface
BUYOption
:
_BUYOption
{}
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOptionValue.h
View file @
fe599067
...
@@ -25,9 +25,12 @@
...
@@ -25,9 +25,12 @@
//
//
#import <Buy/_BUYOptionValue.h>
#import <Buy/_BUYOptionValue.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOptionValue
:
_BUYOptionValue
{}
@interface
BUYOptionValue
:
_BUYOptionValue
{}
-
(
BOOL
)
isEqualToOptionValue
:
(
BUYOptionValue
*
)
other
;
-
(
BOOL
)
isEqualToOptionValue
:
(
nullable
BUYOptionValue
*
)
other
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Buy/_BUYOrder.h>
#import <Buy/_BUYOrder.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOrder
:
_BUYOrder
{}
@interface
BUYOrder
:
_BUYOrder
{}
...
@@ -39,3 +40,5 @@
...
@@ -39,3 +40,5 @@
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.m
View file @
fe599067
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
-
(
NSArray
<
BUYLineItem
*>
*
)
lineItemsArray
-
(
NSArray
<
BUYLineItem
*>
*
)
lineItemsArray
{
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
}
-
(
NSArray
*
)
formatIDsForLineItemsJSON
:
(
NSArray
<
NSDictionary
*>
*
)
lineItems
-
(
NSArray
*
)
formatIDsForLineItemsJSON
:
(
NSArray
<
NSDictionary
*>
*
)
lineItems
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
View file @
fe599067
...
@@ -25,12 +25,14 @@
...
@@ -25,12 +25,14 @@
//
//
#import <Buy/_BUYProduct.h>
#import <Buy/_BUYProduct.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYProduct
:
_BUYProduct
{}
@interface
BUYProduct
:
_BUYProduct
{}
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
publishedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
publishedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSString
*
stringDescription
;
@property
(
nonatomic
,
readonly
,
copy
)
NSString
*
stringDescription
;
/**
/**
...
@@ -70,7 +72,7 @@
...
@@ -70,7 +72,7 @@
*
*
* @return the product variant matching the set of options
* @return the product variant matching the set of options
*/
*/
-
(
BUYProductVariant
*
)
variantWithOptions
:(
NSArray
*
)
options
;
-
(
nullable
BUYProductVariant
*
)
variantWithOptions
:(
NSArray
*
)
options
;
/**
/**
* Determine if the variant is a default variant automatically created by Shopify
* Determine if the variant is a default variant automatically created by Shopify
...
@@ -80,3 +82,5 @@
...
@@ -80,3 +82,5 @@
-
(
BOOL
)
isDefaultVariant
;
-
(
BOOL
)
isDefaultVariant
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
View file @
fe599067
...
@@ -60,17 +60,17 @@
...
@@ -60,17 +60,17 @@
-
(
NSArray
<
BUYImageLink
*>
*
)
imagesArray
-
(
NSArray
<
BUYImageLink
*>
*
)
imagesArray
{
{
return
self
.
images
.
array
;
return
self
.
images
.
array
?:
@[]
;
}
}
-
(
NSArray
<
BUYOption
*>
*
)
optionsArray
-
(
NSArray
<
BUYOption
*>
*
)
optionsArray
{
{
return
self
.
options
.
array
;
return
self
.
options
.
array
?:
@[]
;
}
}
-
(
NSArray
<
BUYProductVariant
*>
*
)
variantsArray
-
(
NSArray
<
BUYProductVariant
*>
*
)
variantsArray
{
{
return
self
.
variants
.
array
;
return
self
.
variants
.
array
?:
@[]
;
}
}
@end
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProductVariant.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Buy/_BUYProductVariant.h>
#import <Buy/_BUYProductVariant.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYOptionValue
;
@class
BUYOptionValue
;
...
@@ -37,7 +38,7 @@
...
@@ -37,7 +38,7 @@
*
*
* @return the option value
* @return the option value
*/
*/
-
(
BUYOptionValue
*
)
optionValueForName
:
(
NSString
*
)
optionName
;
-
(
nullable
BUYOptionValue
*
)
optionValueForName
:
(
NSString
*
)
optionName
;
/**
/**
* Filters array of product variants filtered based on a selected option value
* Filters array of product variants filtered based on a selected option value
...
@@ -50,3 +51,5 @@
...
@@ -50,3 +51,5 @@
+
(
NSArray
*
)
filterProductVariants
:(
NSArray
*
)
productVariants
forOptionValue
:(
BUYOptionValue
*
)
optionValue
;
+
(
NSArray
*
)
filterProductVariants
:(
NSArray
*
)
productVariants
forOptionValue
:(
BUYOptionValue
*
)
optionValue
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.h
View file @
fe599067
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
//
//
#import <Buy/_BUYShop.h>
#import <Buy/_BUYShop.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYShop
:
_BUYShop
{}
@interface
BUYShop
:
_BUYShop
{}
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.h
View file @
fe599067
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
#import <Buy/_BUYCheckout.h>
#import <Buy/_BUYCheckout.h>
#import <Buy/_BUYProductVariant.h>
#import <Buy/_BUYProductVariant.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManager.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYCart
,
BUYCartLineItem
,
BUYAddress
,
BUYGiftCard
;
@class
BUYCart
,
BUYCartLineItem
,
BUYAddress
,
BUYGiftCard
;
@
interface
BUYCheckout
:
_BUYCheckout
{}
@
interface
BUYCheckout
:
_BUYCheckout
{}
@property
(
nonatomic
,
copy
)
NSNumber
*
taxesIncluded
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDictionary
*
attributesDictionary
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDictionary
*
attributesDictionary
;
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
-
(
void
)
updateWithCart
:(
BUYCart
*
)
cart
;
-
(
void
)
updateWithCart
:(
BUYCart
*
)
cart
;
-
(
BUYGiftCard
*
)
giftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
-
(
nullable
BUYGiftCard
*
)
giftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
-
(
void
)
addGiftCard
:(
BUYGiftCard
*
)
giftCard
;
-
(
void
)
addGiftCard
:(
BUYGiftCard
*
)
giftCard
;
-
(
void
)
removeGiftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
-
(
void
)
removeGiftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
...
@@ -61,3 +61,5 @@
...
@@ -61,3 +61,5 @@
-
(
BUYCheckout
*
)
checkoutwithCartToken
:(
NSString
*
)
token
;
-
(
BUYCheckout
*
)
checkoutwithCartToken
:(
NSString
*
)
token
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
View file @
fe599067
...
@@ -118,12 +118,12 @@
...
@@ -118,12 +118,12 @@
-
(
NSArray
<
BUYGiftCard
*>
*
)
giftCardsArray
-
(
NSArray
<
BUYGiftCard
*>
*
)
giftCardsArray
{
{
return
self
.
giftCards
.
array
;
return
self
.
giftCards
.
array
?:
@[]
;
}
}
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
{
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
}
#pragma mark - Update -
#pragma mark - Update -
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckoutAttribute.h
View file @
fe599067
...
@@ -25,9 +25,13 @@
...
@@ -25,9 +25,13 @@
//
//
#import <Buy/_BUYCheckoutAttribute.h>
#import <Buy/_BUYCheckoutAttribute.h>
NS_ASSUME_NONNULL_BEGIN
/**
/**
* A BUYCheckoutAttribute represents a checkout attributes key and value
* A BUYCheckoutAttribute represents a checkout attributes key and value
*/
*/
@interface
BUYCheckoutAttribute
:
_BUYCheckoutAttribute
@interface
BUYCheckoutAttribute
:
_BUYCheckoutAttribute
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYDiscount.h
View file @
fe599067
...
@@ -26,10 +26,15 @@
...
@@ -26,10 +26,15 @@
#import <Buy/_BUYDiscount.h>
#import <Buy/_BUYDiscount.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManager.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYDiscount
:
_BUYDiscount
{}
@interface
BUYDiscount
:
_BUYDiscount
{}
@end
@end
@interface
BUYModelManager
(
BUYDiscountCreating
)
@interface
BUYModelManager
(
BUYDiscountCreating
)
-
(
BUYDiscount
*
)
discountWithCode
:(
NSString
*
)
code
;
-
(
BUYDiscount
*
)
discountWithCode
:(
nullable
NSString
*
)
code
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYGiftCard.h
View file @
fe599067
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#import <Buy/_BUYGiftCard.h>
#import <Buy/_BUYGiftCard.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManager.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYGiftCard
:
_BUYGiftCard
{}
@interface
BUYGiftCard
:
_BUYGiftCard
{}
...
@@ -36,3 +37,5 @@
...
@@ -36,3 +37,5 @@
-
(
BUYGiftCard
*
)
giftCardWithCode
:(
NSString
*
)
code
;
-
(
BUYGiftCard
*
)
giftCardWithCode
:(
NSString
*
)
code
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYMaskedCreditCard.h
View file @
fe599067
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
//
//
#import <Buy/_BUYMaskedCreditCard.h>
#import <Buy/_BUYMaskedCreditCard.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYMaskedCreditCard
:
_BUYMaskedCreditCard
{}
@interface
BUYMaskedCreditCard
:
_BUYMaskedCreditCard
{}
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYShippingRate.h
View file @
fe599067
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
//
//
#import <Buy/_BUYShippingRate.h>
#import <Buy/_BUYShippingRate.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYShippingRate
:
_BUYShippingRate
{}
@interface
BUYShippingRate
:
_BUYShippingRate
{}
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYTaxLine.h
View file @
fe599067
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
//
//
#import <Buy/_BUYTaxLine.h>
#import <Buy/_BUYTaxLine.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYTaxLine
:
_BUYTaxLine
{}
@interface
BUYTaxLine
:
_BUYTaxLine
{}
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYApplePayAdditions.h
View file @
fe599067
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#import <Buy/BUYCheckout.h>
#import <Buy/BUYCheckout.h>
#import <Buy/BUYShippingRate.h>
#import <Buy/BUYShippingRate.h>
#import <Buy/BUYAddress.h>
#import <Buy/BUYAddress.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYCheckout
(
ApplePay
)
@interface
BUYCheckout
(
ApplePay
)
...
@@ -37,7 +38,7 @@
...
@@ -37,7 +38,7 @@
* Returns an array of summary items for all Apple Pay requests. Will use 'PAY TOTAL' as the summary label. Apple recommends
* Returns an array of summary items for all Apple Pay requests. Will use 'PAY TOTAL' as the summary label. Apple recommends
* including the business name in the summary label, so it is recommended to use `buy_summaryItemsWithShopName` instead.
* including the business name in the summary label, so it is recommended to use `buy_summaryItemsWithShopName` instead.
*/
*/
-
(
nonnull
NSArray
<
PKPaymentSummaryItem
*>
*
)
buy_summaryItems
;
-
(
NSArray
<
PKPaymentSummaryItem
*>
*
)
buy_summaryItems
;
/**
/**
* Returns an array of summary items for all Apple Pay requests using the shop name in the "PAY" section
* Returns an array of summary items for all Apple Pay requests using the shop name in the "PAY" section
...
@@ -46,7 +47,7 @@
...
@@ -46,7 +47,7 @@
*
*
* @return An array of PKPaymentSummaryItems
* @return An array of PKPaymentSummaryItems
*/
*/
-
(
nonnull
NSArray
<
PKPaymentSummaryItem
*>
*
)
buy_summaryItemsWithShopName
:(
nullable
NSString
*
)
shopName
;
-
(
NSArray
<
PKPaymentSummaryItem
*>
*
)
buy_summaryItemsWithShopName
:(
nullable
NSString
*
)
shopName
;
@end
@end
...
@@ -59,7 +60,7 @@
...
@@ -59,7 +60,7 @@
*
*
* @return An array of PKShippingMethods
* @return An array of PKShippingMethods
*/
*/
+
(
nonnull
NSArray
<
PKShippingMethod
*>
*
)
buy_convertShippingRatesToShippingMethods
:(
nonnull
NSArray
<
BUYShippingRate
*>
*
)
rates
;
+
(
NSArray
<
PKShippingMethod
*>
*
)
buy_convertShippingRatesToShippingMethods
:(
NSArray
<
BUYShippingRate
*>
*
)
rates
;
@end
@end
...
@@ -72,3 +73,5 @@
...
@@ -72,3 +73,5 @@
-
(
void
)
updateWithContact
:(
nullable
PKContact
*
)
contact
NS_AVAILABLE_IOS
(
9
_0
);
-
(
void
)
updateWithContact
:(
nullable
PKContact
*
)
contact
NS_AVAILABLE_IOS
(
9
_0
);
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYError+BUYAdditions.h
View file @
fe599067
...
@@ -25,12 +25,20 @@
...
@@ -25,12 +25,20 @@
//
//
#import <Buy/BUYError.h>
#import <Buy/BUYError.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYError
(
Checkout
)
@interface
BUYError
(
Checkout
)
+
(
NSArray
<
BUYError
*>
*
)
errorsFromCheckoutJSON
:(
NSDictionary
*
)
json
;
@property
(
readonly
)
NSString
*
quantityRemainingMessage
;
@property
(
readonly
)
NSString
*
quantityRemainingMessage
;
+
(
nullable
NSArray
<
BUYError
*>
*
)
errorsFromCheckoutJSON
:(
NSDictionary
*
)
json
;
@end
@end
@interface
BUYError
(
Customer
)
@interface
BUYError
(
Customer
)
+
(
NSArray
<
BUYError
*>
*
)
errorsFromSignUpJSON
:(
NSDictionary
*
)
json
;
+
(
NSArray
<
BUYError
*>
*
)
errorsFromSignUpJSON
:(
NSDictionary
*
)
json
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Utils/BUYModelManager+ApplePay.h
View file @
fe599067
...
@@ -24,8 +24,9 @@
...
@@ -24,8 +24,9 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
#import <Buy/BUYModelManager.h>
@import
PassKit
;
@import
PassKit
;
#import <Buy/BUYModelManager.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYAddress
;
@class
BUYAddress
;
...
@@ -49,4 +50,6 @@
...
@@ -49,4 +50,6 @@
*/
*/
-
(
BUYAddress
*
)
buyAddressWithContact
:(
PKContact
*
)
contact
NS_AVAILABLE_IOS
(
9
_0
);
-
(
BUYAddress
*
)
buyAddressWithContact
:(
PKContact
*
)
contact
NS_AVAILABLE_IOS
(
9
_0
);
@end
@end
\ No newline at end of file
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYDateTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
BUYDateTransformerName
;
// = @"BUYDate";
extern
NSString
*
const
BUYDateTransformerName
;
// = @"BUYDate";
...
@@ -32,5 +33,9 @@ extern NSString * const BUYDateTransformerName; // = @"BUYDate";
...
@@ -32,5 +33,9 @@ extern NSString * const BUYDateTransformerName; // = @"BUYDate";
* Transforms a date object into a string and back using the provided format string.
* Transforms a date object into a string and back using the provided format string.
*/
*/
@interface
BUYDateTransformer
:
NSValueTransformer
@interface
BUYDateTransformer
:
NSValueTransformer
+
(
instancetype
)
dateTransformerWithFormat
:(
NSString
*
)
format
;
+
(
instancetype
)
dateTransformerWithFormat
:(
NSString
*
)
format
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYDecimalNumberTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
BUYDecimalNumberTransformerName
;
// = @"BUYDecimalNumber";
extern
NSString
*
const
BUYDecimalNumberTransformerName
;
// = @"BUYDecimalNumber";
...
@@ -32,4 +33,7 @@ extern NSString * const BUYDecimalNumberTransformerName; // = @"BUYDecimalNumber
...
@@ -32,4 +33,7 @@ extern NSString * const BUYDecimalNumberTransformerName; // = @"BUYDecimalNumber
* Transforms a decimal number object into a string and back.
* Transforms a decimal number object into a string and back.
*/
*/
@interface
BUYDecimalNumberTransformer
:
NSValueTransformer
@interface
BUYDecimalNumberTransformer
:
NSValueTransformer
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYDeliveryRangeTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
BUYShippingRateDateTransformerName
;
// = @"BUYShippingRateDate";
extern
NSString
*
const
BUYShippingRateDateTransformerName
;
// = @"BUYShippingRateDate";
extern
NSString
*
const
BUYShippingRateDateFormat
;
// = @"yyyy-MM-dd'T'HH:mm:ss.SSSZ";
extern
NSString
*
const
BUYShippingRateDateFormat
;
// = @"yyyy-MM-dd'T'HH:mm:ss.SSSZ";
...
@@ -32,3 +33,5 @@ extern NSString * const BUYShippingRateDateFormat; // = @"yyyy-MM-dd'T'HH:mm:ss.
...
@@ -32,3 +33,5 @@ extern NSString * const BUYShippingRateDateFormat; // = @"yyyy-MM-dd'T'HH:mm:ss.
@interface
BUYDeliveryRangeTransformer
:
NSValueTransformer
@interface
BUYDeliveryRangeTransformer
:
NSValueTransformer
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYFlatCollectionTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
/**
* Transforms an array of objects into a string with given separator.
* Transforms an array of objects into a string with given separator.
...
@@ -44,3 +45,5 @@
...
@@ -44,3 +45,5 @@
+
(
instancetype
)
setTransformerWithSeparator
:(
NSString
*
)
separator
;
+
(
instancetype
)
setTransformerWithSeparator
:(
NSString
*
)
separator
;
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYIdentityTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
BUYIdentityTransformerName
;
// = @"BUYIdentity";
extern
NSString
*
const
BUYIdentityTransformerName
;
// = @"BUYIdentity";
...
@@ -34,3 +35,5 @@ extern NSString * const BUYIdentityTransformerName; // = @"BUYIdentity";
...
@@ -34,3 +35,5 @@ extern NSString * const BUYIdentityTransformerName; // = @"BUYIdentity";
@interface
BUYIdentityTransformer
:
NSValueTransformer
@interface
BUYIdentityTransformer
:
NSValueTransformer
@end
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Value Transformers/BUYURLTransformer.h
View file @
fe599067
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
BUYURLTransformerName
;
// = @"BUYURL";
extern
NSString
*
const
BUYURLTransformerName
;
// = @"BUYURL";
...
@@ -32,4 +33,7 @@ extern NSString * const BUYURLTransformerName; // = @"BUYURL";
...
@@ -32,4 +33,7 @@ extern NSString * const BUYURLTransformerName; // = @"BUYURL";
* Transforms a URL object into a string and back.
* Transforms a URL object into a string and back.
*/
*/
@interface
BUYURLTransformer
:
NSValueTransformer
@interface
BUYURLTransformer
:
NSValueTransformer
@end
@end
NS_ASSUME_NONNULL_END
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