Class: Io::Flow::V0::Models::PaymentType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentType
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .afterpay ⇒ Object
- .ALL ⇒ Object
- .applepay ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PaymentType for this value, creating a new instance for an unknown value.
- .bancontact ⇒ Object
- .card ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of PaymentType for this value, or nil if not found.
- .googlepay ⇒ Object
- .ideal ⇒ Object
- .klarna ⇒ Object
- .paypal ⇒ Object
- .sofort ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ PaymentType
constructor
A new instance of PaymentType.
- #to_hash ⇒ Object
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
#value ⇒ Object (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
.afterpay ⇒ Object
24866 24867 24868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24866 def PaymentType.afterpay @@_afterpay ||= PaymentType.new('afterpay') end |
.ALL ⇒ Object
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 |
.applepay ⇒ Object
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 |
.bancontact ⇒ Object
24870 24871 24872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24870 def PaymentType.bancontact @@_bancontact ||= PaymentType.new('bancontact') end |
.card ⇒ Object
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 |
.googlepay ⇒ Object
24846 24847 24848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24846 def PaymentType.googlepay @@_googlepay ||= PaymentType.new('googlepay') end |
.ideal ⇒ Object
24858 24859 24860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24858 def PaymentType.ideal @@_ideal ||= PaymentType.new('ideal') end |
.klarna ⇒ Object
24842 24843 24844 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24842 def PaymentType.klarna @@_klarna ||= PaymentType.new('klarna') end |
.paypal ⇒ Object
24850 24851 24852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24850 def PaymentType.paypal @@_paypal ||= PaymentType.new('paypal') end |
.sofort ⇒ Object
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_hash ⇒ Object
24874 24875 24876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24874 def to_hash value end |