Class: Io::Flow::V0::Models::ReversalErrorCode

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

Returns a new instance of ReversalErrorCode.



10825
10826
10827
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10825

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10823
10824
10825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10823

def value
  @value
end

Class Method Details

.ALLObject



10845
10846
10847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10845

def ReversalErrorCode.ALL
  @@all ||= [ReversalErrorCode.amount_exceeds_balance, ReversalErrorCode.authorization_declined, ReversalErrorCode.authorization_expired, ReversalErrorCode.invalid_authorization, ReversalErrorCode.invalid_key, ReversalErrorCode.invalid_amount, ReversalErrorCode.invalid_currency, ReversalErrorCode.no_remaining_balance, ReversalErrorCode.partial_reversal_not_supported, ReversalErrorCode.unknown]
end

.amount_exceeds_balanceObject

Amount specified exceeds the remaining authorization balance.



10850
10851
10852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10850

def ReversalErrorCode.amount_exceeds_balance
  @@_amount_exceeds_balance ||= ReversalErrorCode.new('amount_exceeds_balance')
end

.apply(value) ⇒ Object

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



10830
10831
10832
10833
10834
10835
10836
10837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10830

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

.authorization_declinedObject

The authorization was initially declined; there is nothing to reverse.



10855
10856
10857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10855

def ReversalErrorCode.authorization_declined
  @@_authorization_declined ||= ReversalErrorCode.new('authorization_declined')
end

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



10860
10861
10862
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10860

def ReversalErrorCode.authorization_expired
  @@_authorization_expired ||= ReversalErrorCode.new('authorization_expired')
end

.from_string(value) ⇒ Object

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



10840
10841
10842
10843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10840

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

.invalid_amountObject

Amount is not valid - usually because amount was <= 0



10875
10876
10877
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10875

def ReversalErrorCode.invalid_amount
  @@_invalid_amount ||= ReversalErrorCode.new('invalid_amount')
end

.invalid_authorizationObject

The authorization was not found.



10865
10866
10867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10865

def ReversalErrorCode.invalid_authorization
  @@_invalid_authorization ||= ReversalErrorCode.new('invalid_authorization')
end

.invalid_currencyObject

Currency is either not known or invalid



10880
10881
10882
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10880

def ReversalErrorCode.invalid_currency
  @@_invalid_currency ||= ReversalErrorCode.new('invalid_currency')
end

.invalid_keyObject

Invalid key



10870
10871
10872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10870

def ReversalErrorCode.invalid_key
  @@_invalid_key ||= ReversalErrorCode.new('invalid_key')
end

.no_remaining_balanceObject

The authorization has already been fully captured and/or reversed - there are no additional funds to reverse.



10886
10887
10888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10886

def ReversalErrorCode.no_remaining_balance
  @@_no_remaining_balance ||= ReversalErrorCode.new('no_remaining_balance')
end

.partial_reversal_not_supportedObject

Indiciates a request for a partial reversal when the underlying processor does not support it



10892
10893
10894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10892

def ReversalErrorCode.partial_reversal_not_supported
  @@_partial_reversal_not_supported ||= ReversalErrorCode.new('partial_reversal_not_supported')
end

.unknownObject

Unknown or other



10897
10898
10899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10897

def ReversalErrorCode.unknown
  @@_unknown ||= ReversalErrorCode.new('unknown')
end

Instance Method Details

#to_hashObject



10901
10902
10903
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10901

def to_hash
  value
end