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.



8893
8894
8895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8893

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8891
8892
8893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8891

def value
  @value
end

Class Method Details

.ALLObject



8913
8914
8915
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8913

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



8898
8899
8900
8901
8902
8903
8904
8905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8898

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



8943
8944
8945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8943

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

.cvvObject

Declined due to cvv mismatch



8948
8949
8950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8948

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

.fraudObject

Declined due to suspected fraud



8953
8954
8955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8953

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



8908
8909
8910
8911
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8908

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



8918
8919
8920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8918

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

.invalid_expirationObject

Invalid expiration date



8933
8934
8935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8933

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

.invalid_nameObject

Invalid cardholder name



8923
8924
8925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8923

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

.invalid_numberObject

Invalid payment number



8928
8929
8930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8928

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



8938
8939
8940
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8938

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

.unknownObject

Declined due to another reason (details not known)



8958
8959
8960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8958

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

Instance Method Details

#to_hashObject



8962
8963
8964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8962

def to_hash
  value
end