PaymentMethods

public struct PaymentMethods : Decodable

A collection of available payment methods.

  • The regular payment methods.

    Declaration

    Swift

    public let regular: [PaymentMethod]
  • The stored payment methods.

    Declaration

    Swift

    public let stored: [StoredPaymentMethod]
  • Initializes the PaymentMethods.

    Declaration

    Swift

    public init(regular: [PaymentMethod], stored: [StoredPaymentMethod])

    Parameters

    regular

    An array of the regular payment methods.

    stored

    An array of the stored payment methods.

  • Returns the first available payment method of the given type.

    Declaration

    Swift

    public func paymentMethod<T>(ofType type: T.Type) -> T? where T : PaymentMethod

    Parameters

    type

    The type of payment method to retrieve.

    Return Value

    The first available payment method of the given type, or nil if none could be found.