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.
13100 13101 13102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13100 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13098 13099 13100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13098 def value @value end |
Class Method Details
.ALL ⇒ Object
13120 13121 13122 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13120 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
13105 13106 13107 13108 13109 13110 13111 13112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13105 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
13125 13126 13127 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13125 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
13115 13116 13117 13118 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13115 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
13130 13131 13132 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13130 def CaptureDeclineCode.insufficient_funds @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds') end |
.unknown ⇒ Object
Failed due to another reason (details not known)
13135 13136 13137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13135 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
13139 13140 13141 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13139 def to_hash value end |