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.



15737
15738
15739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15737

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15735
15736
15737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15735

def value
  @value
end

Class Method Details

.ALLObject



15757
15758
15759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15757

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.



15762
15763
15764
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15762

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



15742
15743
15744
15745
15746
15747
15748
15749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15742

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.



15767
15768
15769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15767

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



15772
15773
15774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15772

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



15752
15753
15754
15755
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15752

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



15787
15788
15789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15787

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

.invalid_authorizationObject

The authorization was not found.



15777
15778
15779
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15777

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

.invalid_currencyObject

Currency is either not known or invalid



15792
15793
15794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15792

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

.invalid_keyObject

Invalid key



15782
15783
15784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15782

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.



15798
15799
15800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15798

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

.partial_reversal_not_supportedObject

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



15804
15805
15806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15804

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

.unknownObject

Unknown or other



15809
15810
15811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15809

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

Instance Method Details

#to_hashObject



15813
15814
15815
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15813

def to_hash
  value
end