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.
12953 12954 12955 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12953 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12951 12952 12953 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12951 def value @value end |
Class Method Details
.ALL ⇒ Object
12973 12974 12975 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12973 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
12958 12959 12960 12961 12962 12963 12964 12965 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12958 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
13003 13004 13005 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13003 def CardErrorCode.avs @@_avs ||= CardErrorCode.new('avs') end |
.cvv ⇒ Object
Declined due to cvv mismatch
13008 13009 13010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13008 def CardErrorCode.cvv @@_cvv ||= CardErrorCode.new('cvv') end |
.fraud ⇒ Object
Declined due to suspected fraud
13013 13014 13015 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13013 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
12968 12969 12970 12971 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12968 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
12978 12979 12980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12978 def CardErrorCode.invalid_address @@_invalid_address ||= CardErrorCode.new('invalid_address') end |
.invalid_expiration ⇒ Object
Invalid expiration date
12993 12994 12995 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12993 def CardErrorCode.invalid_expiration @@_invalid_expiration ||= CardErrorCode.new('invalid_expiration') end |
.invalid_name ⇒ Object
Invalid cardholder name
12983 12984 12985 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12983 def CardErrorCode.invalid_name @@_invalid_name ||= CardErrorCode.new('invalid_name') end |
.invalid_number ⇒ Object
Invalid payment number
12988 12989 12990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12988 def CardErrorCode.invalid_number @@_invalid_number ||= CardErrorCode.new('invalid_number') end |
.invalid_token_type ⇒ Object
Cannot create a permanent card via an unauthorized request
12998 12999 13000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12998 def CardErrorCode.invalid_token_type @@_invalid_token_type ||= CardErrorCode.new('invalid_token_type') end |
.unknown ⇒ Object
Declined due to another reason (details not known)
13018 13019 13020 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13018 def CardErrorCode.unknown @@_unknown ||= CardErrorCode.new('unknown') end |
Instance Method Details
#to_hash ⇒ Object
13022 13023 13024 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13022 def to_hash value end |