Class: Io::Flow::V0::Models::CardErrorCode

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

Returns a new instance of CardErrorCode.



5367
5368
5369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5367

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5365
5366
5367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5365

def value
  @value
end

Class Method Details

.ALLObject



5387
5388
5389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5387

def CardErrorCode.ALL
  @@all ||= [CardErrorCode.invalid_address, CardErrorCode.invalid_name, CardErrorCode.invalid_number, CardErrorCode.invalid_expiration, CardErrorCode.avs, CardErrorCode.cvv, CardErrorCode.fraud, CardErrorCode.unknown]
end

.apply(value) ⇒ Object

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



5372
5373
5374
5375
5376
5377
5378
5379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5372

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

.avsObject

Declined due to avs mismatch



5412
5413
5414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5412

def CardErrorCode.avs
  @@_avs ||= CardErrorCode.new('avs')
end

.cvvObject

Declined due to cvv mismatch



5417
5418
5419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5417

def CardErrorCode.cvv
  @@_cvv ||= CardErrorCode.new('cvv')
end

.fraudObject

Declined due to suspected fraud



5422
5423
5424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5422

def CardErrorCode.fraud
  @@_fraud ||= CardErrorCode.new('fraud')
end

.from_string(value) ⇒ Object

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



5382
5383
5384
5385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5382

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

.invalid_addressObject

Invalid billing address



5392
5393
5394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5392

def CardErrorCode.invalid_address
  @@_invalid_address ||= CardErrorCode.new('invalid_address')
end

.invalid_expirationObject

Invalid expiration date



5407
5408
5409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5407

def CardErrorCode.invalid_expiration
  @@_invalid_expiration ||= CardErrorCode.new('invalid_expiration')
end

.invalid_nameObject

Invalid cardholder name



5397
5398
5399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5397

def CardErrorCode.invalid_name
  @@_invalid_name ||= CardErrorCode.new('invalid_name')
end

.invalid_numberObject

Invalid payment number



5402
5403
5404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5402

def CardErrorCode.invalid_number
  @@_invalid_number ||= CardErrorCode.new('invalid_number')
end

.unknownObject

Declined due to another reason (details not known)



5427
5428
5429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5427

def CardErrorCode.unknown
  @@_unknown ||= CardErrorCode.new('unknown')
end

Instance Method Details

#to_hashObject



5431
5432
5433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5431

def to_hash
  value
end