Class: Io::Flow::V0::Models::CardErrorCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardErrorCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of CardErrorCode for this value, creating a new instance for an unknown value.
-
.avs ⇒ Object
Declined due to avs mismatch.
-
.cvv ⇒ Object
Declined due to cvv mismatch.
-
.fraud ⇒ Object
Declined due to suspected fraud.
-
.from_string(value) ⇒ Object
Returns the instance of CardErrorCode for this value, or nil if not found.
-
.invalid_address ⇒ Object
Invalid billing address.
-
.invalid_currency ⇒ Object
Invalid requested currency.
-
.invalid_expiration ⇒ Object
Invalid expiration date.
-
.invalid_name ⇒ Object
Invalid cardholder name.
-
.invalid_number ⇒ Object
Invalid payment number.
-
.invalid_token_type ⇒ Object
Cannot create a permanent card via an unauthorized request.
-
.unknown ⇒ Object
Declined due to another reason (details not known).
Instance Method Summary collapse
-
#initialize(value) ⇒ CardErrorCode
constructor
A new instance of CardErrorCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CardErrorCode
Returns a new instance of CardErrorCode.
13568 13569 13570 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13568 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13566 13567 13568 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13566 def value @value end |
Class Method Details
.ALL ⇒ Object
13588 13589 13590 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13588 def CardErrorCode.ALL @@all ||= [CardErrorCode.invalid_address, CardErrorCode.invalid_currency, 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
13573 13574 13575 13576 13577 13578 13579 13580 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13573 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 |
.avs ⇒ Object
Declined due to avs mismatch
13623 13624 13625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13623 def CardErrorCode.avs @@_avs ||= CardErrorCode.new('avs') end |
.cvv ⇒ Object
Declined due to cvv mismatch
13628 13629 13630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13628 def CardErrorCode.cvv @@_cvv ||= CardErrorCode.new('cvv') end |
.fraud ⇒ Object
Declined due to suspected fraud
13633 13634 13635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13633 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
13583 13584 13585 13586 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13583 def CardErrorCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CardErrorCode.ALL.find { |v| v.value == value } end |
.invalid_address ⇒ Object
Invalid billing address
13593 13594 13595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13593 def CardErrorCode.invalid_address @@_invalid_address ||= CardErrorCode.new('invalid_address') end |
.invalid_currency ⇒ Object
Invalid requested currency
13598 13599 13600 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13598 def CardErrorCode.invalid_currency @@_invalid_currency ||= CardErrorCode.new('invalid_currency') end |
.invalid_expiration ⇒ Object
Invalid expiration date
13613 13614 13615 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13613 def CardErrorCode.invalid_expiration @@_invalid_expiration ||= CardErrorCode.new('invalid_expiration') end |
.invalid_name ⇒ Object
Invalid cardholder name
13603 13604 13605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13603 def CardErrorCode.invalid_name @@_invalid_name ||= CardErrorCode.new('invalid_name') end |
.invalid_number ⇒ Object
Invalid payment number
13608 13609 13610 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13608 def CardErrorCode.invalid_number @@_invalid_number ||= CardErrorCode.new('invalid_number') end |
.invalid_token_type ⇒ Object
Cannot create a permanent card via an unauthorized request
13618 13619 13620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13618 def CardErrorCode.invalid_token_type @@_invalid_token_type ||= CardErrorCode.new('invalid_token_type') end |
.unknown ⇒ Object
Declined due to another reason (details not known)
13638 13639 13640 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13638 def CardErrorCode.unknown @@_unknown ||= CardErrorCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
13642 13643 13644 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13642 def to_hash value end |