Class: Io::Flow::V0::Models::PaymentType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PaymentType

Returns a new instance of PaymentType.



24814
24815
24816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24814

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24812
24813
24814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24812

def value
  @value
end

Class Method Details

.afterpayObject



24866
24867
24868
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24866

def PaymentType.afterpay
  @@_afterpay ||= PaymentType.new('afterpay')
end

.ALLObject



24834
24835
24836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24834

def PaymentType.ALL
  @@all ||= [PaymentType.card, PaymentType.klarna, PaymentType.googlepay, PaymentType.paypal, PaymentType.applepay, PaymentType.ideal, PaymentType.sofort, PaymentType.afterpay, PaymentType.bancontact]
end

.applepayObject



24854
24855
24856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24854

def PaymentType.applepay
  @@_applepay ||= PaymentType.new('applepay')
end

.apply(value) ⇒ Object

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



24819
24820
24821
24822
24823
24824
24825
24826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24819

def PaymentType.apply(value)
  if value.instance_of?(PaymentType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PaymentType.new(value))
  end
end

.bancontactObject



24870
24871
24872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24870

def PaymentType.bancontact
  @@_bancontact ||= PaymentType.new('bancontact')
end

.cardObject



24838
24839
24840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24838

def PaymentType.card
  @@_card ||= PaymentType.new('card')
end

.from_string(value) ⇒ Object

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



24829
24830
24831
24832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24829

def PaymentType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PaymentType.ALL.find { |v| v.value == value }
end

.googlepayObject



24846
24847
24848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24846

def PaymentType.googlepay
  @@_googlepay ||= PaymentType.new('googlepay')
end

.idealObject



24858
24859
24860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24858

def PaymentType.ideal
  @@_ideal ||= PaymentType.new('ideal')
end

.klarnaObject



24842
24843
24844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24842

def PaymentType.klarna
  @@_klarna ||= PaymentType.new('klarna')
end

.paypalObject



24850
24851
24852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24850

def PaymentType.paypal
  @@_paypal ||= PaymentType.new('paypal')
end

.sofortObject



24862
24863
24864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24862

def PaymentType.sofort
  @@_sofort ||= PaymentType.new('sofort')
end

Instance Method Details

#to_hashObject



24874
24875
24876
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24874

def to_hash
  value
end