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.
5318 5319 5320 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5318 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
5316 5317 5318 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5316 def value @value end |
Class Method Details
.ALL ⇒ Object
5338 5339 5340 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5338 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
5323 5324 5325 5326 5327 5328 5329 5330 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5323 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
5343 5344 5345 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5343 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
5333 5334 5335 5336 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5333 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
5348 5349 5350 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5348 def CaptureDeclineCode.insufficient_funds @@_insufficient_funds ||= CaptureDeclineCode.new('insufficient_funds') end |
.unknown ⇒ Object
Failed due to another reason (details not known)
5353 5354 5355 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5353 def CaptureDeclineCode.unknown @@_unknown ||= CaptureDeclineCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
5357 5358 5359 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5357 def to_hash value end |