ShippingMethod

@objc(PPCShippingMethod)
@objcMembers
final class ShippingMethod
extension ShippingMethod : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, Equatable, Hashable, NSObjectProtocol

Shipping option for an order used when creating an order with Orders API. If you want to show your shipping options in our Paysheet, you should provide purchaseUnits[].shipping.options, otherwise, our Paysheet won’t display any shipping options.

  • The shipping cost for the selected option.

    Declaration

    Swift

    let amount: UnitAmount?
  • id

    A unique ID that identifies a payer-selected shipping option.

    Declaration

    Swift

    let id: String
  • 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
  • Undocumented

    Declaration

    Swift

    init(id: String, label: String, selected: Bool, type: ShippingType = .none, amount: UnitAmount? = nil)
  • A description that the payer sees, which helps them choose an appropriate shipping option. For example, Free Shipping, USPS Priority Shipping, Expédition prioritaire USPS, or USPS yōuxiān fā huò. Localize this description to the payer’s locale.

    Declaration

    Swift

    let label: String
  • If true it represents the shipping option that the merchant expects to be selected for the buyer when they view the shipping options within the PayPal Checkout experience. The selected shipping option must match the shipping cost in the order breakdown. Only one shipping option per purchase unit can be selected.

    Declaration

    Swift

    var selected: Bool { get }
  • The method by which the payer wants to get their items.

    Declaration

    Swift

    let type: ShippingType