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.
8375 8376 8377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8375 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8373 8374 8375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8373 def value @value end |
Class Method Details
.ALL ⇒ Object
8395 8396 8397 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8395 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
8380 8381 8382 8383 8384 8385 8386 8387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8380 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.)
8400 8401 8402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8400 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
8390 8391 8392 8393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8390 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
8412 8413 8414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8412 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.
8406 8407 8408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8406 def PaymentMethodType.online @@_online ||= PaymentMethodType.new('online') end |
Instance Method Details
#to_hash ⇒ Object
8416 8417 8418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8416 def to_hash value end |