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.



12239
12240
12241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12239

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12237
12238
12239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12237

def value
  @value
end

Class Method Details

.ALLObject



12259
12260
12261
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12259

def CardErrorCode.ALL
  @@all ||= [CardErrorCode.invalid_address, CardErrorCode.invalid_name, CardErrorCode.invalid_number, CardErrorCode.invalid_expiration, CardErrorCode.invalid_token_type, 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



12244
12245
12246
12247
12248
12249
12250
12251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12244

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



12289
12290
12291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12289

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

.cvvObject

Declined due to cvv mismatch



12294
12295
12296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12294

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

.fraudObject

Declined due to suspected fraud



12299
12300
12301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12299

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



12254
12255
12256
12257
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12254

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



12264
12265
12266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12264

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

.invalid_expirationObject

Invalid expiration date



12279
12280
12281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12279

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

.invalid_nameObject

Invalid cardholder name



12269
12270
12271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12269

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

.invalid_numberObject

Invalid payment number



12274
12275
12276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12274

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



12284
12285
12286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12284

def CardErrorCode.invalid_token_type
  @@_invalid_token_type ||= CardErrorCode.new('invalid_token_type')
end

.unknownObject

Declined due to another reason (details not known)



12304
12305
12306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12304

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

Instance Method Details

#to_hashObject



12308
12309
12310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12308

def to_hash
  value
end