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.



15024
15025
15026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15024

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15022
15023
15024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15022

def value
  @value
end

Class Method Details

.ALLObject



15044
15045
15046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15044

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.



15049
15050
15051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15049

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



15029
15030
15031
15032
15033
15034
15035
15036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15029

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.



15054
15055
15056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15054

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



15059
15060
15061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15059

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



15039
15040
15041
15042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15039

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



15074
15075
15076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15074

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

.invalid_authorizationObject

The authorization was not found.



15064
15065
15066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15064

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

.invalid_currencyObject

Currency is either not known or invalid



15079
15080
15081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15079

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

.invalid_keyObject

Invalid key



15069
15070
15071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15069

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.



15085
15086
15087
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15085

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



15091
15092
15093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15091

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

.unknownObject

Unknown or other



15096
15097
15098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15096

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

Instance Method Details

#to_hashObject



15100
15101
15102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15100

def to_hash
  value
end