Amount

@objc(PPCPurchaseUnitAmount)
@objcMembers
class Amount
extension PurchaseUnit.Amount : 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.

  • The breakdown of the amount. Breakdown provides details such as total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.

    Declaration

    Swift

    let breakdown: PurchaseUnit.Breakdown?
  • The three-character ISO-4217 currency code that identifies the currency.

    Declaration

    Swift

    let currencyCode: CurrencyCode
  • Undocumented

    Declaration

    Swift

    init(currencyCode: CurrencyCode, value: String, breakdown: PurchaseUnit.Breakdown? = 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

    required init(from decoder: Decoder) throws
  • The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths.

    • Maximum length: 32.
    • Pattern: ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$

    Declaration

    Swift

    let value: String