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.
8842 8843 8844 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8842 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8840 8841 8842 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8840 def value @value end |
Class Method Details
.ALL ⇒ Object
8862 8863 8864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8862 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
8847 8848 8849 8850 8851 8852 8853 8854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8847 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
8867 8868 8869 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8867 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
8857 8858 8859 8860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8857 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
8872 8873 8874 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8872 def CaptureDeclineCode.insufficient_funds @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds') end |
.unknown ⇒ Object
Failed due to another reason (details not known)
8877 8878 8879 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8877 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
8881 8882 8883 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8881 def to_hash value end |