Class: Io::Flow::V0::Models::TransactionSource

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

Returns a new instance of TransactionSource.



27980
27981
27982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27980

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



27978
27979
27980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27978

def value
  @value
end

Class Method Details

.adjustmentObject



28016
28017
28018
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28016

def TransactionSource.adjustment
  @@_adjustment ||= TransactionSource.new('adjustment')
end

.apply(value) ⇒ Object

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



27985
27986
27987
27988
27989
27990
27991
27992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27985

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

.captureObject



28004
28005
28006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28004

def TransactionSource.capture
  @@_capture ||= TransactionSource.new('capture')
end

.channelObject



28060
28061
28062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28060

def TransactionSource.channel
  @@_channel ||= TransactionSource.new('channel')
end

.channel_billedObject



28064
28065
28066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28064

def TransactionSource.channel_billed
  @@_channel_billed ||= TransactionSource.new('channel_billed')
end

.disputeObject



28012
28013
28014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28012

def TransactionSource.dispute
  @@_dispute ||= TransactionSource.new('dispute')
end

.dutyObject



28044
28045
28046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28044

def TransactionSource.duty
  @@_duty ||= TransactionSource.new('duty')
end

.from_string(value) ⇒ Object

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



27995
27996
27997
27998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27995

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

.order_serviceObject



28068
28069
28070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28068

def TransactionSource.order_service
  @@_order_service ||= TransactionSource.new('order_service')
end

.other_adjustmentObject



28052
28053
28054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28052

def TransactionSource.other_adjustment
  @@_other_adjustment ||= TransactionSource.new('other_adjustment')
end

.platform_feeObject



28036
28037
28038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28036

def TransactionSource.platform_fee
  @@_platform_fee ||= TransactionSource.new('platform_fee')
end

.refundObject



28008
28009
28010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28008

def TransactionSource.refund
  @@_refund ||= TransactionSource.new('refund')
end

.reversalObject



28020
28021
28022
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28020

def TransactionSource.reversal
  @@_reversal ||= TransactionSource.new('reversal')
end

.shipping_labelObject



28024
28025
28026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28024

def TransactionSource.shipping_label
  @@_shipping_label ||= TransactionSource.new('shipping_label')
end

.shipping_label_revenue_shareObject



28032
28033
28034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28032

def TransactionSource.shipping_label_revenue_share
  @@_shipping_label_revenue_share ||= TransactionSource.new('shipping_label_revenue_share')
end

.shipping_label_serviceObject



28028
28029
28030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28028

def TransactionSource.shipping_label_service
  @@_shipping_label_service ||= TransactionSource.new('shipping_label_service')
end

.taxObject



28040
28041
28042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28040

def TransactionSource.tax
  @@_tax ||= TransactionSource.new('tax')
end

.tax_adjustmentObject



28056
28057
28058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28056

def TransactionSource.tax_adjustment
  @@_tax_adjustment ||= TransactionSource.new('tax_adjustment')
end

.virtual_card_captureObject



28072
28073
28074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28072

def TransactionSource.virtual_card_capture
  @@_virtual_card_capture ||= TransactionSource.new('virtual_card_capture')
end

.virtual_card_refundObject



28076
28077
28078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28076

def TransactionSource.virtual_card_refund
  @@_virtual_card_refund ||= TransactionSource.new('virtual_card_refund')
end

.withholdingObject



28048
28049
28050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28048

def TransactionSource.withholding
  @@_withholding ||= TransactionSource.new('withholding')
end

Instance Method Details

#to_hashObject



28080
28081
28082
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28080

def to_hash
  value
end