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.
-
.installment_plan ⇒ Object
An installment plan payment represents that the user has elected an installment plan to pay for this order.
-
.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.
17374 17375 17376 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17374 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17372 17373 17374 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17372 def value @value end |
Class Method Details
.ALL ⇒ Object
17394 17395 17396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17394 def OrderPaymentType.ALL @@all ||= [OrderPaymentType.card, OrderPaymentType.online, OrderPaymentType.credit, OrderPaymentType.installment_plan, OrderPaymentType.cash_on_delivery] end |
.apply(value) ⇒ Object
Returns the instance of OrderPaymentType for this value, creating a new instance for an unknown value
17379 17380 17381 17382 17383 17384 17385 17386 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17379 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
17399 17400 17401 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17399 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.
17425 17426 17427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17425 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
17410 17411 17412 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17410 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
17389 17390 17391 17392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17389 def OrderPaymentType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) OrderPaymentType.ALL.find { |v| v.value == value } end |
.installment_plan ⇒ Object
An installment plan payment represents that the user has elected an installment plan to pay for this order. For the purposes of the order, the balance will reflect fully paid for the total value of the installment plan, even though individual installments may be created in the future. Note this feature was deprecated in early 2020.
17419 17420 17421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17419 def OrderPaymentType.installment_plan @@_installment_plan ||= OrderPaymentType.new('installment_plan') end |
.online ⇒ Object
Represents an online payment (e.g. paypal, alipay, etc)
17404 17405 17406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17404 def OrderPaymentType.online @@_online ||= OrderPaymentType.new('online') end |
Instance Method Details
#to_hash ⇒ Object
17429 17430 17431 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17429 def to_hash value end |