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.



14473
14474
14475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14473

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14471
14472
14473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14471

def value
  @value
end

Class Method Details

.ALLObject



14493
14494
14495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14493

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.



14498
14499
14500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14498

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



14478
14479
14480
14481
14482
14483
14484
14485
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14478

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.



14503
14504
14505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14503

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



14508
14509
14510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14508

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



14488
14489
14490
14491
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14488

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



14523
14524
14525
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14523

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

.invalid_authorizationObject

The authorization was not found.



14513
14514
14515
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14513

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

.invalid_currencyObject

Currency is either not known or invalid



14528
14529
14530
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14528

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

.invalid_keyObject

Invalid key



14518
14519
14520
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14518

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.



14534
14535
14536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14534

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



14540
14541
14542
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14540

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

.unknownObject

Unknown or other



14545
14546
14547
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14545

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

Instance Method Details

#to_hashObject



14549
14550
14551
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14549

def to_hash
  value
end