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.



12744
12745
12746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12744

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12742
12743
12744
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12742

def value
  @value
end

Class Method Details

.ALLObject



12764
12765
12766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12764

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



12749
12750
12751
12752
12753
12754
12755
12756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12749

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



12778
12779
12780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12778

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.



12785
12786
12787
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12785

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



12759
12760
12761
12762
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12759

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.



12771
12772
12773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12771

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

Instance Method Details

#to_hashObject



12789
12790
12791
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12789

def to_hash
  value
end