SCPCart

Objective-C


@interface SCPCart : NSObject

Swift

class Cart : NSObject

An SCPCart object contains information about what line items are included in the current transaction. A cart object should be created and then passed into Terminal.shared.setReaderDisplay(), which will display the cart’s contents on the reader’s screen.

The SCPCart only represents exactly what will be shown on the screen, and is not reflective of what the customer is actually charged. You are responsible for making sure that tax and total reflect what is in the cart.

These values are exactly what will be shown on the screen and do not reflect what the user is actually charged.

Note

Only Internet readers support setReaderDisplay functionality

  • The cart’s line items. Default’s to an empty array of line items.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<SCPCartLineItem *> *_Nonnull lineItems;

    Swift

    var lineItems: [CartLineItem] { get }
  • tax

    The displayed tax amount, provided in the currency’s smallest unit. Defaults to 0.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger tax;

    Swift

    var tax: Int { get }
  • The cart’s total balance, provided in the currency’s smallest unit.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger total;

    Swift

    var total: Int { get }
  • The currency of the cart.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull currency;

    Swift

    var currency: String { get }
  • Unavailable

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    Declaration

    Objective-C

    + (nonnull instancetype)new;