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.



17647
17648
17649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17647

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17645
17646
17647
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17645

def value
  @value
end

Class Method Details

.ALLObject



17667
17668
17669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17667

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.



17672
17673
17674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17672

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



17652
17653
17654
17655
17656
17657
17658
17659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17652

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.



17677
17678
17679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17677

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



17682
17683
17684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17682

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



17662
17663
17664
17665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17662

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



17697
17698
17699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17697

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

.invalid_authorizationObject

The authorization was not found.



17687
17688
17689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17687

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

.invalid_currencyObject

Currency is either not known or invalid



17702
17703
17704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17702

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

.invalid_keyObject

Invalid key



17692
17693
17694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17692

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.



17708
17709
17710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17708

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



17714
17715
17716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17714

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

.unknownObject

Unknown or other



17719
17720
17721
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17719

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

Instance Method Details

#to_hashObject



17723
17724
17725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17723

def to_hash
  value
end