Item

@objc(PPCPurchaseUnitItem)
@objcMembers
class Item
extension PurchaseUnit.Item : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol

An array of items that the customer purchases from the merchant.

  • The item category type.

    Declaration

    Swift

    let category: PurchaseUnit.Category
  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Declaration

    Swift

    required init(from decoder: Decoder) throws
  • Undocumented

    Declaration

    Swift

    init(name: String, unitAmount: UnitAmount, quantity: String, tax: PurchaseUnit.Tax? = nil, itemDescription: String? = nil, sku: String? = nil, category: PurchaseUnit.Category = .none)
  • The detailed item description. Maximum length: 127.

    Declaration

    Swift

    let itemDescription: String?
  • The item name or title. Minumum length: 1. Maximum length: 127

    Declaration

    Swift

    let name: String
  • The item quantity. Must be a whole number. Maximum length: 10. Pattern: ^[1-9][0-9]{0,9}$.

    Declaration

    Swift

    let quantity: String
  • sku

    The stock keeping unit (SKU) for the item. Maximum length: 127.

    Declaration

    Swift

    let sku: String?
  • tax

    The item tax for each unit. If tax is specified, purchase_units[].amount.breakdown.tax_total is required. Must equal tax * quantity for all items. tax.value can not be a negative number.

    Declaration

    Swift

    let tax: PurchaseUnit.Tax?
  • The item price or rate per unit. If you specify unitAmount, purchase_units[].amount.breakdown.item_total is required. Must equal unitAmount * quantity for all items. unitAmount.value can not be a negative number.

    Declaration

    Swift

    let unitAmount: UnitAmount