Class: Io::Flow::V0::Models::OrderPaymentType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderPaymentType
- 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 OrderPaymentType for this value, creating a new instance for an unknown value.
-
.card ⇒ Object
Represents a payment in the form of a credit or debit card.
-
.cash_on_delivery ⇒ Object
Request to pay the balance with cash on delivery.
-
.credit ⇒ Object
A payment in the form of a credit of some type (e.g. a store credit, gift card) applied to an order.
-
.from_string(value) ⇒ Object
Returns the instance of OrderPaymentType for this value, or nil if not found.
-
.online ⇒ Object
Represents an online payment (e.g. paypal, alipay, etc).
Instance Method Summary collapse
-
#initialize(value) ⇒ OrderPaymentType
constructor
A new instance of OrderPaymentType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ OrderPaymentType
Returns a new instance of OrderPaymentType.
9739 9740 9741 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9739 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9737 9738 9739 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9737 def value @value end |
Class Method Details
.ALL ⇒ Object
9759 9760 9761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9759 def OrderPaymentType.ALL @@all ||= [OrderPaymentType.card, OrderPaymentType.online, OrderPaymentType.credit, OrderPaymentType.cash_on_delivery] end |
.apply(value) ⇒ Object
Returns the instance of OrderPaymentType for this value, creating a new instance for an unknown value
9744 9745 9746 9747 9748 9749 9750 9751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9744 def OrderPaymentType.apply(value) if value.instance_of?(OrderPaymentType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || OrderPaymentType.new(value)) end end |
.card ⇒ Object
Represents a payment in the form of a credit or debit card
9764 9765 9766 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9764 def OrderPaymentType.card @@_card ||= OrderPaymentType.new('card') end |
.cash_on_delivery ⇒ Object
Request to pay the balance with cash on delivery. Offered only when the final mile carriers support cash on delivery.
9781 9782 9783 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9781 def OrderPaymentType.cash_on_delivery @@_cash_on_delivery ||= OrderPaymentType.new('cash_on_delivery') end |
.credit ⇒ Object
A payment in the form of a credit of some type (e.g. a store credit, gift card) applied to an order
9775 9776 9777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9775 def OrderPaymentType.credit @@_credit ||= OrderPaymentType.new('credit') end |
.from_string(value) ⇒ Object
Returns the instance of OrderPaymentType for this value, or nil if not found
9754 9755 9756 9757 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9754 def OrderPaymentType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) OrderPaymentType.ALL.find { |v| v.value == value } end |
.online ⇒ Object
Represents an online payment (e.g. paypal, alipay, etc)
9769 9770 9771 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9769 def OrderPaymentType.online @@_online ||= OrderPaymentType.new('online') end |
Instance Method Details
#to_hash ⇒ Object
9785 9786 9787 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9785 def to_hash value end |