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.



6941
6942
6943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6941

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6939
6940
6941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6939

def value
  @value
end

Class Method Details

.ALLObject



6961
6962
6963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6961

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



6946
6947
6948
6949
6950
6951
6952
6953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6946

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



6986
6987
6988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6986

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

.cvvObject

Declined due to cvv mismatch



6991
6992
6993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6991

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

.fraudObject

Declined due to suspected fraud



6996
6997
6998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6996

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



6956
6957
6958
6959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6956

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



6966
6967
6968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6966

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

.invalid_expirationObject

Invalid expiration date



6981
6982
6983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6981

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

.invalid_nameObject

Invalid cardholder name



6971
6972
6973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6971

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

.invalid_numberObject

Invalid payment number



6976
6977
6978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6976

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

.unknownObject

Declined due to another reason (details not known)



7001
7002
7003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7001

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

Instance Method Details

#to_hashObject



7005
7006
7007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7005

def to_hash
  value
end