Class: Io::Flow::V0::Models::CvvResultCode

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) ⇒ CvvResultCode

Returns a new instance of CvvResultCode.



18434
18435
18436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18434

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18432
18433
18434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18432

def value
  @value
end

Class Method Details

.ALLObject



18454
18455
18456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18454

def CvvResultCode.ALL
  @@all ||= [CvvResultCode.matched, CvvResultCode.not_available, CvvResultCode.not_checked, CvvResultCode.not_matched]
end

.apply(value) ⇒ Object

Returns the instance of CvvResultCode for this value, creating a new instance for an unknown value



18439
18440
18441
18442
18443
18444
18445
18446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18439

def CvvResultCode.apply(value)
  if value.instance_of?(CvvResultCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CvvResultCode.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of CvvResultCode for this value, or nil if not found



18449
18450
18451
18452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18449

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

.matchedObject



18458
18459
18460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18458

def CvvResultCode.matched
  @@_matched ||= CvvResultCode.new('matched')
end

.not_availableObject

Cvv verification could not be performed due to a technical issue



18463
18464
18465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18463

def CvvResultCode.not_available
  @@_not_available ||= CvvResultCode.new('not_available')
end

.not_checkedObject

Issuer did not perform cvv verification



18468
18469
18470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18468

def CvvResultCode.not_checked
  @@_not_checked ||= CvvResultCode.new('not_checked')
end

.not_matchedObject



18472
18473
18474
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18472

def CvvResultCode.not_matched
  @@_not_matched ||= CvvResultCode.new('not_matched')
end

Instance Method Details

#to_hashObject



18476
18477
18478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18476

def to_hash
  value
end