class Io::Flow::V0::Models::PaymentMethodType

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 24444
def PaymentMethodType.ALL
  @@all ||= [PaymentMethodType.card, PaymentMethodType.online, PaymentMethodType.offline]
end
apply(value) click to toggle source

Returns the instance of PaymentMethodType for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 24429
def PaymentMethodType.apply(value)
  if value.instance_of?(PaymentMethodType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PaymentMethodType.new(value))
  end
end
card() click to toggle source

Represents all form of card payment (e.g. credit, debit, etc.)

# File lib/flow_commerce/flow_api_v0_client.rb, line 24449
def PaymentMethodType.card
  @@_card ||= PaymentMethodType.new('card')
end
from_string(value) click to toggle source

Returns the instance of PaymentMethodType for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 24439
def PaymentMethodType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PaymentMethodType.ALL.find { |v| v.value == value }
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 24424
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
offline() click to toggle source

Offline payment method types represent payments like Cash On Delivery which require offline collection

# File lib/flow_commerce/flow_api_v0_client.rb, line 24461
def PaymentMethodType.offline
  @@_offline ||= PaymentMethodType.new('offline')
end
online() click to toggle source

Represents the most common form of alternative payment methods which require some degree of integration online (e.g. a redirect) to complete payment.

# File lib/flow_commerce/flow_api_v0_client.rb, line 24455
def PaymentMethodType.online
  @@_online ||= PaymentMethodType.new('online')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 24465
def to_hash
  value
end