Class: Io::Flow::V0::Models::CvvCode

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ CvvCode

Returns a new instance of CvvCode.



11090
11091
11092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11090

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11088
11089
11090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11088

def value
  @value
end

Class Method Details

.ALLObject



11110
11111
11112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11110

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



11095
11096
11097
11098
11099
11100
11101
11102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11095

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



11105
11106
11107
11108
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11105

def CvvCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CvvCode.ALL.find { |v| v.value == value }
end

.matchObject

CVV matches



11115
11116
11117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11115

def CvvCode.match
  @@_match ||= CvvCode.new('match')
end

.no_matchObject

CVV did not match; Specific reason not available



11130
11131
11132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11130

def CvvCode.no_match
  @@_no_match ||= CvvCode.new('no_match')
end

.suspiciousObject

CVV did not match; Transaction is possibly fraudulent



11120
11121
11122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11120

def CvvCode.suspicious
  @@_suspicious ||= CvvCode.new('suspicious')
end

.unsupportedObject

CVV did not match; Issuer does not support card verification numbers



11125
11126
11127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11125

def CvvCode.unsupported
  @@_unsupported ||= CvvCode.new('unsupported')
end

Instance Method Details

#to_hashObject



11134
11135
11136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11134

def to_hash
  value
end