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.
17062 17063 17064 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17062 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17060 17061 17062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17060 def value @value end |
Class Method Details
.ALL ⇒ Object
17082 17083 17084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17082 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
17067 17068 17069 17070 17071 17072 17073 17074 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17067 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
17077 17078 17079 17080 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17077 def CvvCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CvvCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
CVV matches
17087 17088 17089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17087 def CvvCode.match @@_match ||= CvvCode.new('match') end |
.no_match ⇒ Object
CVV did not match; Specific reason not available
17102 17103 17104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17102 def CvvCode.no_match @@_no_match ||= CvvCode.new('no_match') end |
Instance Method Details
#to_hash ⇒ Object
17106 17107 17108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17106 def to_hash value end |