Class: Io::Flow::V0::Models::CaptureDeclineCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CaptureDeclineCode
- 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
-
.apply(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, creating a new instance for an unknown value.
-
.expired ⇒ Object
Payment authorization has expired.
-
.from_string(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, or nil if not found.
-
.insufficient_funds ⇒ Object
The amount to capture exceeded the amount authorized and not yet captured.
-
.unknown ⇒ Object
Failed due to another reason (details not known).
Instance Method Summary collapse
-
#initialize(value) ⇒ CaptureDeclineCode
constructor
A new instance of CaptureDeclineCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CaptureDeclineCode
Returns a new instance of CaptureDeclineCode.
10811 10812 10813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10811 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10809 10810 10811 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10809 def value @value end |
Class Method Details
.ALL ⇒ Object
10831 10832 10833 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10831 def CaptureDeclineCode.ALL @@all ||= [CaptureDeclineCode.expired, CaptureDeclineCode.insufficient_funds, CaptureDeclineCode.unknown] end |
.apply(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, creating a new instance for an unknown value
10816 10817 10818 10819 10820 10821 10822 10823 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10816 def CaptureDeclineCode.apply(value) if value.instance_of?(CaptureDeclineCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CaptureDeclineCode.new(value)) end end |
.expired ⇒ Object
Payment authorization has expired
10836 10837 10838 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10836 def CaptureDeclineCode.expired @@_expired ||= CaptureDeclineCode.new('expired') end |
.from_string(value) ⇒ Object
Returns the instance of CaptureDeclineCode for this value, or nil if not found
10826 10827 10828 10829 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10826 def CaptureDeclineCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CaptureDeclineCode.ALL.find { |v| v.value == value } end |
.insufficient_funds ⇒ Object
The amount to capture exceeded the amount authorized and not yet captured
10841 10842 10843 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10841 def CaptureDeclineCode.insufficient_funds @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds') end |
.unknown ⇒ Object
Failed due to another reason (details not known)
10846 10847 10848 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10846 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
10850 10851 10852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10850 def to_hash value end |