Class: Io::Flow::V0::Models::AuthorizationError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AuthorizationError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Details for why an authorization 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 = {}) ⇒ AuthorizationError
constructor
A new instance of AuthorizationError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AuthorizationError
Returns a new instance of AuthorizationError.
20605 20606 20607 20608 20609 20610 20611 20612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20605 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :messages], 'AuthorizationError') @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::AuthorizationDeclineCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeclineCode.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.
20603 20604 20605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20603 def avs @avs end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
20603 20604 20605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20603 def code @code end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
20603 20604 20605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20603 def cvv @cvv end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
20603 20604 20605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20603 def @messages end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20618 20619 20620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20618 def copy(incoming={}) AuthorizationError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20622 20623 20624 20625 20626 20627 20628 20629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20622 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
20614 20615 20616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20614 def to_json JSON.dump(to_hash) end |