STPKlarnaLineItem

Objective-C

@interface STPKlarnaLineItem : NSObject

Swift

class STPKlarnaLineItem : NSObject

An object representing a line item in a Klarna source.

  • The line item’s type. One of sku (for a product), tax (for taxes), or shipping (for shipping costs).

    Declaration

    Objective-C

    @property (nonatomic) STPKlarnaLineItemType itemType;

    Swift

    var itemType: STPKlarnaLineItemType { get set }
  • The human-readable description for the line item.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull itemDescription;

    Swift

    var itemDescription: String { get set }
  • The quantity to display for this line item.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSNumber *_Nonnull quantity;

    Swift

    @NSCopying var quantity: NSNumber { get set }
  • The total price of this line item. Note: This is the total price after multiplying by the quantity, not the price of an individual item. It is denominated in the currency of the STPSourceParams which contains it.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSNumber *_Nonnull totalAmount;

    Swift

    @NSCopying var totalAmount: NSNumber { get set }
  • Initialize this STPKlarnaLineItem with a set of parameters.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithItemType:(STPKlarnaLineItemType)itemType
                             itemDescription:(nonnull NSString *)itemDescription
                                    quantity:(nonnull NSNumber *)quantity
                                 totalAmount:(nonnull NSNumber *)totalAmount;

    Swift

    init(itemType: STPKlarnaLineItemType, itemDescription: String, quantity: NSNumber, totalAmount: NSNumber)

    Parameters

    itemType

    The line item’s type.

    itemDescription

    The human-readable description for the line item.

    quantity

    The quantity to display for this line item.

    totalAmount

    The total price of this line item.