Class: Io::Flow::V0::Models::ReversalErrorCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReversalErrorCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.amount_exceeds_balance ⇒ Object
Amount specified exceeds the remaining authorization balance.
-
.apply(value) ⇒ Object
Returns the instance of ReversalErrorCode for this value, creating a new instance for an unknown value.
-
.authorization_declined ⇒ Object
The authorization was initially declined; there is nothing to reverse.
-
.authorization_expired ⇒ Object
The authorization has expired and can no longer be reversed.
-
.from_string(value) ⇒ Object
Returns the instance of ReversalErrorCode for this value, or nil if not found.
-
.invalid_amount ⇒ Object
Amount is not valid - usually because amount was <= 0.
-
.invalid_authorization ⇒ Object
The authorization was not found.
-
.invalid_currency ⇒ Object
Currency is either not known or invalid.
-
.invalid_key ⇒ Object
Invalid key.
-
.no_remaining_balance ⇒ Object
The authorization has already been fully captured and/or reversed - there are no additional funds to reverse.
-
.partial_reversal_not_supported ⇒ Object
Indiciates a request for a partial reversal when the underlying processor does not support it.
-
.unknown ⇒ Object
Unknown or other.
Instance Method Summary collapse
-
#initialize(value) ⇒ ReversalErrorCode
constructor
A new instance of ReversalErrorCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ReversalErrorCode
Returns a new instance of ReversalErrorCode.
12638 12639 12640 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12638 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12636 12637 12638 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12636 def value @value end |
Class Method Details
.ALL ⇒ Object
12658 12659 12660 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12658 def ReversalErrorCode.ALL @@all ||= [ReversalErrorCode.amount_exceeds_balance, ReversalErrorCode., ReversalErrorCode., ReversalErrorCode., ReversalErrorCode.invalid_key, ReversalErrorCode.invalid_amount, ReversalErrorCode.invalid_currency, ReversalErrorCode.no_remaining_balance, ReversalErrorCode.partial_reversal_not_supported, ReversalErrorCode.unknown] end |
.amount_exceeds_balance ⇒ Object
Amount specified exceeds the remaining authorization balance.
12663 12664 12665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12663 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
12643 12644 12645 12646 12647 12648 12649 12650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12643 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_declined ⇒ Object
The authorization was initially declined; there is nothing to reverse.
12668 12669 12670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12668 def ReversalErrorCode. ||= ReversalErrorCode.new('authorization_declined') end |
.authorization_expired ⇒ Object
The authorization has expired and can no longer be reversed.
12673 12674 12675 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12673 def ReversalErrorCode. ||= ReversalErrorCode.new('authorization_expired') end |
.from_string(value) ⇒ Object
Returns the instance of ReversalErrorCode for this value, or nil if not found
12653 12654 12655 12656 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12653 def ReversalErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ReversalErrorCode.ALL.find { |v| v.value == value } end |
.invalid_amount ⇒ Object
Amount is not valid - usually because amount was <= 0
12688 12689 12690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12688 def ReversalErrorCode.invalid_amount @@_invalid_amount ||= ReversalErrorCode.new('invalid_amount') end |
.invalid_authorization ⇒ Object
The authorization was not found.
12678 12679 12680 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12678 def ReversalErrorCode. ||= ReversalErrorCode.new('invalid_authorization') end |
.invalid_currency ⇒ Object
Currency is either not known or invalid
12693 12694 12695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12693 def ReversalErrorCode.invalid_currency @@_invalid_currency ||= ReversalErrorCode.new('invalid_currency') end |
.invalid_key ⇒ Object
Invalid key
12683 12684 12685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12683 def ReversalErrorCode.invalid_key @@_invalid_key ||= ReversalErrorCode.new('invalid_key') end |
.no_remaining_balance ⇒ Object
The authorization has already been fully captured and/or reversed - there are no additional funds to reverse.
12699 12700 12701 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12699 def ReversalErrorCode.no_remaining_balance @@_no_remaining_balance ||= ReversalErrorCode.new('no_remaining_balance') end |
.partial_reversal_not_supported ⇒ Object
Indiciates a request for a partial reversal when the underlying processor does not support it
12705 12706 12707 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12705 def ReversalErrorCode.partial_reversal_not_supported @@_partial_reversal_not_supported ||= ReversalErrorCode.new('partial_reversal_not_supported') end |
.unknown ⇒ Object
Unknown or other
12710 12711 12712 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12710 def ReversalErrorCode.unknown @@_unknown ||= ReversalErrorCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
12714 12715 12716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12714 def to_hash value end |