BTVenmoLineItem

Objective-C

@interface BTVenmoLineItem : NSObject

Swift

class BTVenmoLineItem : NSObject

A Venmo line item to be displayed in the Venmo Paysheet.

  • 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, readonly) NSNumber *_Nonnull quantity;

    Swift

    var quantity: NSNumber { 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, nullable) NSString *unitAmount;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) BTVenmoLineItemKind kind;

    Swift

    var kind: BTVenmoLineItemKind { 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, copy, nullable) NSURL *url;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    init(quantity: NSNumber, unitAmount: String, name: String, kind: BTVenmoLineItemKind)

    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.