Class: Io::Flow::V0::Models::PaymentMethodType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentMethodType
- 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
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of PaymentMethodType for this value, creating a new instance for an unknown value.
-
.card ⇒ Object
Represents all form of card payment (e.g. credit, debit, etc.).
-
.from_string(value) ⇒ Object
Returns the instance of PaymentMethodType for this value, or nil if not found.
-
.offline ⇒ Object
Offline payment method types represent payments like Cash On Delivery which require offline collection.
-
.online ⇒ Object
Represents the most common form of alternative payment methods which require some degree of integration online (e.g. a redirect) to complete payment.
Instance Method Summary collapse
-
#initialize(value) ⇒ PaymentMethodType
constructor
A new instance of PaymentMethodType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PaymentMethodType
Returns a new instance of PaymentMethodType.
13709 13710 13711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13709 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13707 13708 13709 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13707 def value @value end |
Class Method Details
.ALL ⇒ Object
13729 13730 13731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13729 def PaymentMethodType.ALL @@all ||= [PaymentMethodType.card, PaymentMethodType.online, PaymentMethodType.offline] end |
.apply(value) ⇒ Object
Returns the instance of PaymentMethodType for this value, creating a new instance for an unknown value
13714 13715 13716 13717 13718 13719 13720 13721 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13714 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 ⇒ Object
Represents all form of card payment (e.g. credit, debit, etc.)
13734 13735 13736 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13734 def PaymentMethodType.card @@_card ||= PaymentMethodType.new('card') end |
.from_string(value) ⇒ Object
Returns the instance of PaymentMethodType for this value, or nil if not found
13724 13725 13726 13727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13724 def PaymentMethodType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PaymentMethodType.ALL.find { |v| v.value == value } end |
.offline ⇒ Object
Offline payment method types represent payments like Cash On Delivery which require offline collection
13746 13747 13748 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13746 def PaymentMethodType.offline @@_offline ||= PaymentMethodType.new('offline') end |
.online ⇒ Object
Represents the most common form of alternative payment methods which require some degree of integration online (e.g. a redirect) to complete payment.
13740 13741 13742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13740 def PaymentMethodType.online @@_online ||= PaymentMethodType.new('online') end |
Instance Method Details
#to_hash ⇒ Object
13750 13751 13752 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13750 def to_hash value end |