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.



18738
18739
18740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18738

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18736
18737
18738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18736

def value
  @value
end

Class Method Details

.ALLObject



18758
18759
18760
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18758

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.



18763
18764
18765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18763

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



18743
18744
18745
18746
18747
18748
18749
18750
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18743

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.



18768
18769
18770
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18768

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



18773
18774
18775
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18773

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



18753
18754
18755
18756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18753

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



18788
18789
18790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18788

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

.invalid_authorizationObject

The authorization was not found.



18778
18779
18780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18778

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

.invalid_currencyObject

Currency is either not known or invalid



18793
18794
18795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18793

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

.invalid_keyObject

Invalid key



18783
18784
18785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18783

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.



18799
18800
18801
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18799

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



18805
18806
18807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18805

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

.unknownObject

Unknown or other



18810
18811
18812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18810

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

Instance Method Details

#to_hashObject



18814
18815
18816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18814

def to_hash
  value
end