Method

public struct Method
extension PaymentMethod.Method: ApiMethod
extension PaymentMethod.Method: Encodable, Decodable

API method for PaymentMethod.

  • Client application key.

    Declaration

    Swift

    public let oauthToken: String
  • The ID of the saved payment method.

    Declaration

    Swift

    public let paymentMethodId: String
  • Creates instance of API method for PaymentMethod.

    Declaration

    Swift

    public init(oauthToken: String,
                paymentMethodId: String)

    Parameters

    oauthToken

    Client application key.

    paymentMethodId

    The ID of the saved payment method.

    Return Value

    Instance of API method for PaymentMethod.

ApiMethod

  • Declaration

    Swift

    public typealias Response = PaymentMethod
  • Declaration

    Swift

    public var hostProviderKey: String { get }
  • Declaration

    Swift

    public var httpMethod: HTTPMethod { get }
  • Declaration

    Swift

    public var parametersEncoding: ParametersEncoding { get }
  • Declaration

    Swift

    public var headers: Headers { get }
  • Declaration

    Swift

    public func urlInfo(from hostProvider: HostProvider) throws -> URLInfo

Method: Encodable, Decodable

  • Encodes this value into the given encoder. If the value fails to encode anything, encoder will encode an empty keyed container in its place. This function throws an error if any values are invalid for the given encoder’s format.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.

  • 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

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to read data from.