BTPayPalLineItem

Objective-C

@interface BTPayPalLineItem : NSObject

Swift

class BTPayPalLineItem : NSObject

A PayPal line item to be displayed in the PayPal checkout flow.

  • Number of units of the item purchased. This value must be a whole number and can’t be negative or zero.

    Declaration

    Objective-C

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

    Swift

    var quantity: String { get }
  • Per-unit price of the item. Can include up to 2 decimal places. This value can’t be negative or zero.

    Declaration

    Objective-C

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

    Swift

    var unitAmount: String { get }
  • Item name. Maximum 127 characters.

    Declaration

    Objective-C

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

    Swift

    var name: String { get }
  • Indicates whether the line item is a debit (sale) or credit (refund) to the customer.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BTPayPalLineItemKind kind;

    Swift

    var kind: BTPayPalLineItemKind { get }
  • Optional: Per-unit tax price of the item. Can include up to 2 decimal places. This value can’t be negative or zero.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *unitTaxAmount;

    Swift

    var unitTaxAmount: String? { get set }
  • Optional: Item description. Maximum 127 characters.

    Declaration

    Objective-C

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

    Swift

    var itemDescription: String? { get set }
  • Optional: Product or UPC code for the item. Maximum 127 characters.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *productCode;

    Swift

    var productCode: String? { get set }
  • url

    Optional: The URL to product information.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURL *url;

    Swift

    var url: URL? { get set }
  • Initialize a PayPayLineItem

    Declaration

    Objective-C

    - (nonnull instancetype)initWithQuantity:(nonnull NSString *)quantity
                                  unitAmount:(nonnull NSString *)unitAmount
                                        name:(nonnull NSString *)name
                                        kind:(BTPayPalLineItemKind)kind;

    Swift

    init(quantity: String, unitAmount: String, name: String, kind: BTPayPalLineItemKind)

    Parameters

    quantity

    Number of units of the item purchased. Can include up to 4 decimal places. This value can’t be negative or zero.

    unitAmount

    Per-unit price of the item. Can include up to 4 decimal places. This value can’t be negative or zero.

    name

    Item name. Maximum 127 characters.

    kind

    Indicates whether the line item is a debit (sale) or credit (refund) to the customer.

    Return Value

    A PayPalLineItem.

  • Unavailable

    Please use initWithQuantity:unitAmount:name:kind:

    Base initializer - do not use.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Returns the line item in a dictionary.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)requestParameters;

    Swift

    func requestParameters() -> [AnyHashable : Any]

    Return Value

    A dictionary with the line item information formatted for a request.