Class: Io::Flow::V0::Models::CardError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Details for why a card was not created
Instance Attribute Summary collapse
-
#avs ⇒ Object
readonly
Returns the value of attribute avs.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#cvv ⇒ Object
readonly
Returns the value of attribute cvv.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardError
constructor
A new instance of CardError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CardError
Returns a new instance of CardError.
15441 15442 15443 15444 15445 15446 15447 15448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15441 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'CardError') @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CardErrorCode) ? x : ::Io::Flow::V0::Models::CardErrorCode.apply(x)) @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @avs = (x = opts.delete(:avs); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Avs) ? x : ::Io::Flow::V0::Models::Avs.new(x))) @cvv = (x = opts.delete(:cvv); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Cvv) ? x : ::Io::Flow::V0::Models::Cvv.new(x))) end |
Instance Attribute Details
#avs ⇒ Object (readonly)
Returns the value of attribute avs.
15439 15440 15441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15439 def avs @avs end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
15439 15440 15441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15439 def code @code end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
15439 15440 15441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15439 def cvv @cvv end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
15439 15440 15441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15439 def @messages end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15454 15455 15456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15454 def copy(incoming={}) CardError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15458 15459 15460 15461 15462 15463 15464 15465 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15458 def to_hash { :code => code.value, :messages => , :avs => avs.nil? ? nil : avs.to_hash, :cvv => cvv.nil? ? nil : cvv.to_hash } end |
#to_json ⇒ Object
15450 15451 15452 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15450 def to_json JSON.dump(to_hash) end |