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.



12202
12203
12204
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12202

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12200
12201
12202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12200

def value
  @value
end

Class Method Details

.ALLObject



12222
12223
12224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12222

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.



12227
12228
12229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12227

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



12207
12208
12209
12210
12211
12212
12213
12214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12207

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.



12232
12233
12234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12232

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



12237
12238
12239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12237

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



12217
12218
12219
12220
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12217

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



12252
12253
12254
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12252

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

.invalid_authorizationObject

The authorization was not found.



12242
12243
12244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12242

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

.invalid_currencyObject

Currency is either not known or invalid



12257
12258
12259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12257

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

.invalid_keyObject

Invalid key



12247
12248
12249
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12247

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.



12263
12264
12265
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12263

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

.partial_reversal_not_supportedObject

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



12269
12270
12271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12269

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

.unknownObject

Unknown or other



12274
12275
12276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12274

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

Instance Method Details

#to_hashObject



12278
12279
12280
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12278

def to_hash
  value
end