Class: Io::Flow::V0::Models::CvvCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CvvCode
- 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 CvvCode for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of CvvCode for this value, or nil if not found.
-
.match ⇒ Object
CVV matches.
-
.no_match ⇒ Object
CVV did not match; Specific reason not available.
-
.suspicious ⇒ Object
CVV did not match; Transaction is possibly fraudulent.
-
.unsupported ⇒ Object
CVV did not match; Issuer does not support card verification numbers.
Instance Method Summary collapse
-
#initialize(value) ⇒ CvvCode
constructor
A new instance of CvvCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CvvCode
Returns a new instance of CvvCode.
10619 10620 10621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10619 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10617 10618 10619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10617 def value @value end |
Class Method Details
.ALL ⇒ Object
10639 10640 10641 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10639 def CvvCode.ALL @@all ||= [CvvCode.match, CvvCode.suspicious, CvvCode.unsupported, CvvCode.no_match] end |
.apply(value) ⇒ Object
Returns the instance of CvvCode for this value, creating a new instance for an unknown value
10624 10625 10626 10627 10628 10629 10630 10631 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10624 def CvvCode.apply(value) if value.instance_of?(CvvCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || CvvCode.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of CvvCode for this value, or nil if not found
10634 10635 10636 10637 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10634 def CvvCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CvvCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
CVV matches
10644 10645 10646 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10644 def CvvCode.match @@_match ||= CvvCode.new('match') end |
.no_match ⇒ Object
CVV did not match; Specific reason not available
10659 10660 10661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10659 def CvvCode.no_match @@_no_match ||= CvvCode.new('no_match') end |
Instance Method Details
#to_hash ⇒ Object
10663 10664 10665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10663 def to_hash value end |