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.



26145
26146
26147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26145

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26143
26144
26145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26143

def value
  @value
end

Class Method Details

.amount_exceeds_balanceObject

Amount specified exceeds the remaining authorization balance.



26170
26171
26172
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26170

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



26150
26151
26152
26153
26154
26155
26156
26157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26150

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.



26175
26176
26177
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26175

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

.authorization_expiredObject

The authorization has expired and can no longer be reversed.



26180
26181
26182
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26180

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



26160
26161
26162
26163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26160

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



26195
26196
26197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26195

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

.invalid_authorizationObject

The authorization was not found.



26185
26186
26187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26185

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

.invalid_currencyObject

Currency is either not known or invalid



26200
26201
26202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26200

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

.invalid_keyObject

Invalid key



26190
26191
26192
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26190

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.



26206
26207
26208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26206

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



26212
26213
26214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26212

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

.unknownObject

Unknown or other



26217
26218
26219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26217

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

Instance Method Details

#to_hashObject



26221
26222
26223
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26221

def to_hash
  value
end