Class: Io::Flow::V0::Models::CancelReason

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) ⇒ CancelReason

Returns a new instance of CancelReason.



10730
10731
10732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10730

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10728
10729
10730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10728

def value
  @value
end

Class Method Details

.ALLObject



10750
10751
10752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10750

def CancelReason.ALL
  @@all ||= [CancelReason.out_of_stock, CancelReason.consumer_requested, CancelReason.flow_cancel]
end

.apply(value) ⇒ Object

Returns the instance of CancelReason for this value, creating a new instance for an unknown value



10735
10736
10737
10738
10739
10740
10741
10742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10735

def CancelReason.apply(value)
  if value.instance_of?(CancelReason)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CancelReason.new(value))
  end
end

.consumer_requestedObject

A consumer requested cancellation of an item qty and the fulfillment party has acknowledged that the qty will not be shipped. This is a cancel of the ordered quantity and will reduce or refund the consumer’s payment



10764
10765
10766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10764

def CancelReason.consumer_requested
  @@_consumer_requested ||= CancelReason.new('consumer_requested')
end

.flow_cancelObject

Flow has had to cancel an order, possibly due to fraud activity or inability to collect payment. This will cancel the ordered quantity. All known parties will be notified.



10771
10772
10773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10771

def CancelReason.flow_cancel
  @@_flow_cancel ||= CancelReason.new('flow_cancel')
end

.from_string(value) ⇒ Object

Returns the instance of CancelReason for this value, or nil if not found



10745
10746
10747
10748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10745

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

.out_of_stockObject

Out of stock is a permanent cancel of the fulfillment of an item qty. If no other fulfillment parties exist, this will cancel the ordered quantity and reduce or refund the consumer’s payment.



10757
10758
10759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10757

def CancelReason.out_of_stock
  @@_out_of_stock ||= CancelReason.new('out_of_stock')
end

Instance Method Details

#to_hashObject



10775
10776
10777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10775

def to_hash
  value
end