SCPCartBuilder
Objective-C
@interface SCPCartBuilder : SCPBuilder <SCPCart *>
                Swift
class CartBuilder : SCPBuilder<Cart>
                A builder class for SCPCart objects.
- 
                  
                  
Initializes a new instance of the
SCPCartBuilderclass with the provided currency.Declaration
Objective-C
- (nonnull instancetype)initWithCurrency:(nonnull NSString *)currency;Swift
init(currency: String)Parameters
currencyThe currency of the cart. This is a required attribute of the cart and cannot be nil.
 - 
                  
                  
See
SCPCart.currencyNote
This is a required attribute of the cart and cannot be nil.Declaration
Objective-C
- (nonnull SCPCartBuilder *)setCurrency:(nonnull NSString *)currency;Swift
func setCurrency(_ currency: String) -> CartBuilderReturn Value
selffor convenience with method chaining. - 
                  
                  
See
SCPCart.taxNote
If not set, defaults to 0.Declaration
Objective-C
- (nonnull SCPCartBuilder *)setTax:(NSInteger)tax;Swift
func setTax(_ tax: Int) -> CartBuilderReturn Value
selffor convenience with method chaining. - 
                  
                  
See
SCPCart.totalNote
If not set, defaults to 0.Declaration
Objective-C
- (nonnull SCPCartBuilder *)setTotal:(NSInteger)total;Swift
func setTotal(_ total: Int) -> CartBuilderReturn Value
selffor convenience with method chaining. - 
                  
                  
Note
If not set, defaults to an empty array.Declaration
Objective-C
- (nonnull SCPCartBuilder *)setLineItems: (nonnull NSArray<SCPCartLineItem *> *)lineItems;Swift
func setLineItems(_ lineItems: [CartLineItem]) -> CartBuilderReturn Value
selffor convenience with method chaining. - 
                  
                  
Unavailable
Use
initWithCurrency.Declaration
Objective-C
- (nonnull instancetype)init; - 
                  
                  
Unavailable
Use
initWithCurrency.Declaration
Objective-C
+ (nonnull instancetype)new;