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.



24100
24101
24102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24100

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24098
24099
24100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24098

def value
  @value
end

Class Method Details

.ALLObject



24120
24121
24122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24120

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.



24125
24126
24127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24125

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



24105
24106
24107
24108
24109
24110
24111
24112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24105

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.



24130
24131
24132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24130

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



24135
24136
24137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24135

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



24115
24116
24117
24118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24115

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



24150
24151
24152
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24150

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

.invalid_authorizationObject

The authorization was not found.



24140
24141
24142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24140

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

.invalid_currencyObject

Currency is either not known or invalid



24155
24156
24157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24155

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

.invalid_keyObject

Invalid key



24145
24146
24147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24145

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.



24161
24162
24163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24161

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



24167
24168
24169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24167

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

.unknownObject

Unknown or other



24172
24173
24174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24172

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

Instance Method Details

#to_hashObject



24176
24177
24178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24176

def to_hash
  value
end