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



9818
9819
9820
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9818

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9816
9817
9818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9816

def value
  @value
end

Class Method Details

.ALLObject



9838
9839
9840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9838

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



9823
9824
9825
9826
9827
9828
9829
9830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9823

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



9868
9869
9870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9868

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

.cvvObject

Declined due to cvv mismatch



9873
9874
9875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9873

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

.fraudObject

Declined due to suspected fraud



9878
9879
9880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9878

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



9833
9834
9835
9836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9833

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



9843
9844
9845
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9843

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

.invalid_expirationObject

Invalid expiration date



9858
9859
9860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9858

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

.invalid_nameObject

Invalid cardholder name



9848
9849
9850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9848

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

.invalid_numberObject

Invalid payment number



9853
9854
9855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9853

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

.invalid_token_typeObject

Cannot create a permanent card via an unauthorized request



9863
9864
9865
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9863

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

.unknownObject

Declined due to another reason (details not known)



9883
9884
9885
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9883

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

Instance Method Details

#to_hashObject



9887
9888
9889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9887

def to_hash
  value
end