Class: Io::Flow::V0::Models::OrderPaymentType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ OrderPaymentType

Returns a new instance of OrderPaymentType.



20314
20315
20316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20314

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20312
20313
20314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20312

def value
  @value
end

Class Method Details

.ALLObject



20334
20335
20336
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20334

def OrderPaymentType.ALL
  @@all ||= [OrderPaymentType.card, OrderPaymentType.online, OrderPaymentType.credit, OrderPaymentType.subsidized, 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



20319
20320
20321
20322
20323
20324
20325
20326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20319

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

.cardObject

Represents a payment in the form of a credit or debit card



20339
20340
20341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20339

def OrderPaymentType.card
  @@_card ||= OrderPaymentType.new('card')
end

.cash_on_deliveryObject

Request to pay the balance with cash on delivery. Offered only when the final mile carriers support cash on delivery.



20373
20374
20375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20373

def OrderPaymentType.cash_on_delivery
  @@_cash_on_delivery ||= OrderPaymentType.new('cash_on_delivery')
end

.creditObject

A payment in the form of a credit of some type (e.g. a store credit, gift card) applied to an order



20350
20351
20352
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20350

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



20329
20330
20331
20332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20329

def OrderPaymentType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  OrderPaymentType.ALL.find { |v| v.value == value }
end

.installment_planObject

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.



20367
20368
20369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20367

def OrderPaymentType.installment_plan
  @@_installment_plan ||= OrderPaymentType.new('installment_plan')
end

.onlineObject

Represents an online payment (e.g. paypal, alipay, etc)



20344
20345
20346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20344

def OrderPaymentType.online
  @@_online ||= OrderPaymentType.new('online')
end

.subsidizedObject

Subsidized indicates that this payment is being subsidized by the organization

  • and Flow’s billing system will directly invoice the client for this payment.

This is intended to identify payment for replacement orders and in the future other types of orders (eg. influencer orders).



20358
20359
20360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20358

def OrderPaymentType.subsidized
  @@_subsidized ||= OrderPaymentType.new('subsidized')
end

Instance Method Details

#to_hashObject



20377
20378
20379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20377

def to_hash
  value
end