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.



17637
17638
17639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17637

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17635
17636
17637
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17635

def value
  @value
end

Class Method Details

.apply(value) ⇒ Object

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



17642
17643
17644
17645
17646
17647
17648
17649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17642

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



17692
17693
17694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17692

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

.cvvObject

Declined due to cvv mismatch



17697
17698
17699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17697

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

.fraudObject

Declined due to suspected fraud



17702
17703
17704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17702

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



17652
17653
17654
17655
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17652

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



17662
17663
17664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17662

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

.invalid_currencyObject

Invalid requested currency



17667
17668
17669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17667

def CardErrorCode.invalid_currency
  @@_invalid_currency ||= CardErrorCode.new('invalid_currency')
end

.invalid_expirationObject

Invalid expiration date



17682
17683
17684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17682

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

.invalid_nameObject

Invalid cardholder name



17672
17673
17674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17672

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

.invalid_numberObject

Invalid payment number



17677
17678
17679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17677

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



17687
17688
17689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17687

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

.unknownObject

Declined due to another reason (details not known)



17707
17708
17709
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17707

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

Instance Method Details

#to_hashObject



17711
17712
17713
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17711

def to_hash
  value
end