SCPCartLineItemBuilder
Objective-C
@interface SCPCartLineItemBuilder : SCPBuilder <SCPCartLineItem *>
Swift
class CartLineItemBuilder : SCPBuilder<CartLineItem>
A builder class for SCPCartLineItem
objects.
-
Initializes a new instance of
SCPCartLineItemBuilder
with the required fields.Declaration
Objective-C
- (nonnull instancetype)initWithDisplayName:(nonnull NSString *)displayName;
Swift
init(displayName: String)
Parameters
displayName
The description or name of the item.
-
Declaration
Objective-C
- (nonnull SCPCartLineItemBuilder *)setDisplayName: (nonnull NSString *)displayName;
Swift
func setDisplayName(_ displayName: String) -> CartLineItemBuilder
Return Value
self
for convenience with method chaining. -
Note
If not set, defaults to 1.Declaration
Objective-C
- (nonnull SCPCartLineItemBuilder *)setQuantity:(NSInteger)quantity;
Swift
func setQuantity(_ quantity: Int) -> CartLineItemBuilder
Return Value
self
for convenience with method chaining. -
Note
if not set, defaults to 0Declaration
Objective-C
- (nonnull SCPCartLineItemBuilder *)setAmount:(NSInteger)amount;
Swift
func setAmount(_ amount: Int) -> CartLineItemBuilder
Return Value
self
for convenience with method chaining. -
Unavailable
Use
initWithDisplayName
.Declaration
Objective-C
- (nonnull instancetype)init;
-
Unavailable
Use
initWithDisplayName
.Declaration
Objective-C
+ (nonnull instancetype)new;