PurchaseUnit

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

A class that represents the possible values to be passed as part of the purchase unit object. Purchase units request documentation guide

  • The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify amount.breakdown, the amount equals item_total plus tax_total plus shipping plus handling plus insurance minus shipping_discount minus discount. The amount must be a positive number.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitAmount)
    @objcMembers
    class Amount
    extension PurchaseUnit.Amount : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitBreakdown)
    @objcMembers
    class Breakdown
    extension PurchaseUnit.Breakdown : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The item category type.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitCategory)
    enum Category
    extension PurchaseUnit.Category : CaseIterable, Equatable, Hashable, RawRepresentable
  • The funds that are held on behalf of the merchant.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitDisbursementMode)
    enum DisbursementMode
    extension PurchaseUnit.DisbursementMode : CaseIterable, Equatable, Hashable, RawRepresentable
  • An array of items that the customer purchases from the merchant.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitItem)
    @objcMembers
    class Item
    extension PurchaseUnit.Item : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The merchant who receives payment for this transaction.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitPayee)
    @objcMembers
    class Payee
    extension PurchaseUnit.Payee : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • Any additional payment instructions for PayPal Commerce Platform customers. Enables features for the PayPal Commerce Platform, such as delayed disbursement and collection of a platform fee. Applies during order creation for captured payments or during capture of authorized payments.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitPaymentInstruction)
    @objcMembers
    class PaymentInstruction
    extension PurchaseUnit.PaymentInstruction : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • An array of various fees, commissions, tips, or donations.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitPlatformFees)
    @objcMembers
    class PlatformFees
    extension PurchaseUnit.PlatformFees : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The name and address of the person to whom to ship the items.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitShipping)
    @objcMembers
    class Shipping
    extension PurchaseUnit.Shipping : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The name of the person to whom to ship the items. Supports only the full_name property.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitShippingName)
    @objcMembers
    class ShippingName
    extension PurchaseUnit.ShippingName : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • 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.

    See more

    Declaration

    Swift

    @objc(PPCPurchaseUnitTax)
    @objcMembers
    class Tax
    extension PurchaseUnit.Tax : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol
  • The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any. If you specify amount.breakdown, the amount equals item_total plus tax_total plus shipping plus handling plus insurance minus shipping_discount minus discount. The amount must be a positive number.

    Declaration

    Swift

    let amount: PurchaseUnit.Amount
  • The API caller-provided external ID. Used to reconcile client transactions with PayPal transactions. Appears in transaction and settlement reports but is not visible to the payer. Maximum length: 127.

    Declaration

    Swift

    let customId: String?
  • Undocumented

    Declaration

    Swift

    init(amount: PurchaseUnit.Amount, referenceId: String? = nil, payee: PurchaseUnit.Payee? = nil, paymentInstruction: PurchaseUnit.PaymentInstruction? = nil, purchaseUnitDescription: String? = nil, customId: String? = nil, invoiceId: String? = nil, softDescriptor: String? = nil, items: [PurchaseUnit.Item]? = nil, shipping: PurchaseUnit.Shipping? = nil)
  • 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

    init(from decoder: Decoder) throws
  • The API caller-provided external invoice number for this order. Appears in both the payer’s transaction history and the emails that the payer receives. Maximum length: 127.

    Declaration

    Swift

    let invoiceId: String?
  • An array of items that the customer purchases from the merchant.

    Declaration

    Swift

    let items: [PurchaseUnit.Item]?
  • The merchant who receives payment for this transaction.

    Declaration

    Swift

    let payee: PurchaseUnit.Payee?
  • Any additional payment instructions for PayPal Commerce Platform customers. Enables features for the PayPal Commerce Platform, such as delayed disbursement and collection of a platform fee. Applies during order creation for captured payments or during capture of authorized payments.

    Declaration

    Swift

    let paymentInstruction: PurchaseUnit.PaymentInstruction?
  • The purchase description. Maximum length: 127.

    Declaration

    Swift

    let purchaseUnitDescription: String?
  • The API caller-provided external ID for the purchase unit. If you omit this value and the order contains only one purchase unit, PayPal sets this value to default. Maximum length: 256.

    Declaration

    Swift

    let referenceId: String?
  • The name and address of the person to whom to ship the items.

    Declaration

    Swift

    let shipping: PurchaseUnit.Shipping?
  • The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer’s card statement. Maximum length: 22. Full requirements can be found in the API documentation for purchase unit

    Declaration

    Swift

    let softDescriptor: String?