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_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.
7525 7526 7527 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7525 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7523 7524 7525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7523 def value @value end |
Class Method Details
.ALL ⇒ Object
7545 7546 7547 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7545 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
7530 7531 7532 7533 7534 7535 7536 7537 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7530 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
7575 7576 7577 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7575 def CardErrorCode.avs @@_avs ||= CardErrorCode.new('avs') end |
.cvv ⇒ Object
Declined due to cvv mismatch
7580 7581 7582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7580 def CardErrorCode.cvv @@_cvv ||= CardErrorCode.new('cvv') end |
.fraud ⇒ Object
Declined due to suspected fraud
7585 7586 7587 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7585 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
7540 7541 7542 7543 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7540 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
7550 7551 7552 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7550 def CardErrorCode.invalid_address @@_invalid_address ||= CardErrorCode.new('invalid_address') end |
.invalid_expiration ⇒ Object
Invalid expiration date
7565 7566 7567 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7565 def CardErrorCode.invalid_expiration @@_invalid_expiration ||= CardErrorCode.new('invalid_expiration') end |
.invalid_name ⇒ Object
Invalid cardholder name
7555 7556 7557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7555 def CardErrorCode.invalid_name @@_invalid_name ||= CardErrorCode.new('invalid_name') end |
.invalid_number ⇒ Object
Invalid payment number
7560 7561 7562 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7560 def CardErrorCode.invalid_number @@_invalid_number ||= CardErrorCode.new('invalid_number') end |
.invalid_token_type ⇒ Object
Cannot create a permanent card via an unauthorized request
7570 7571 7572 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7570 def CardErrorCode.invalid_token_type @@_invalid_token_type ||= CardErrorCode.new('invalid_token_type') end |
.unknown ⇒ Object
Declined due to another reason (details not known)
7590 7591 7592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7590 def CardErrorCode.unknown @@_unknown ||= CardErrorCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
7594 7595 7596 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7594 def to_hash value end |