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.
13767 13768 13769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13767 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13765 13766 13767 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13765 def value @value end |
Class Method Details
.ALL ⇒ Object
13787 13788 13789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13787 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
13772 13773 13774 13775 13776 13777 13778 13779 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13772 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
13792 13793 13794 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13792 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
13782 13783 13784 13785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13782 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
13797 13798 13799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13797 def CaptureDeclineCode.insufficient_funds @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds') end |
.unknown ⇒ Object
Failed due to another reason (details not known)
13802 13803 13804 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13802 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
13806 13807 13808 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13806 def to_hash value end |