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.



7591
7592
7593
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7591

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7589
7590
7591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7589

def value
  @value
end

Class Method Details

.ALLObject



7611
7612
7613
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7611

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



7596
7597
7598
7599
7600
7601
7602
7603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7596

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



7641
7642
7643
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7641

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

.cvvObject

Declined due to cvv mismatch



7646
7647
7648
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7646

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

.fraudObject

Declined due to suspected fraud



7651
7652
7653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7651

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



7606
7607
7608
7609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7606

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



7616
7617
7618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7616

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

.invalid_expirationObject

Invalid expiration date



7631
7632
7633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7631

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

.invalid_nameObject

Invalid cardholder name



7621
7622
7623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7621

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

.invalid_numberObject

Invalid payment number



7626
7627
7628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7626

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



7636
7637
7638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7636

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

.unknownObject

Declined due to another reason (details not known)



7656
7657
7658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7656

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

Instance Method Details

#to_hashObject



7660
7661
7662
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7660

def to_hash
  value
end