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.



10590
10591
10592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10590

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10588
10589
10590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10588

def value
  @value
end

Class Method Details

.ALLObject



10610
10611
10612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10610

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



10595
10596
10597
10598
10599
10600
10601
10602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10595

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



10640
10641
10642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10640

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

.cvvObject

Declined due to cvv mismatch



10645
10646
10647
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10645

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

.fraudObject

Declined due to suspected fraud



10650
10651
10652
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10650

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



10605
10606
10607
10608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10605

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



10615
10616
10617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10615

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

.invalid_expirationObject

Invalid expiration date



10630
10631
10632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10630

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

.invalid_nameObject

Invalid cardholder name



10620
10621
10622
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10620

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

.invalid_numberObject

Invalid payment number



10625
10626
10627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10625

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



10635
10636
10637
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10635

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

.unknownObject

Declined due to another reason (details not known)



10655
10656
10657
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10655

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

Instance Method Details

#to_hashObject



10659
10660
10661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10659

def to_hash
  value
end