Class: Io::Flow::V0::Models::AuthorizationResult
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AuthorizationResult
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Contains the result of the authorization. If an immediate response is not available, the state will be ‘pending’ - this usually indicates fraud review requires additional time / verification (or a potential network issue with the issuing bank).
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#avs ⇒ Object
readonly
Returns the value of attribute avs.
-
#cvv ⇒ Object
readonly
Returns the value of attribute cvv.
-
#decline_code ⇒ Object
readonly
Returns the value of attribute decline_code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#three_d_secure ⇒ Object
readonly
Returns the value of attribute three_d_secure.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AuthorizationResult
constructor
A new instance of AuthorizationResult.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AuthorizationResult
Returns a new instance of AuthorizationResult.
20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20724 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status], 'AuthorizationResult') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AuthorizationStatus) ? x : ::Io::Flow::V0::Models::AuthorizationStatus.apply(x)) @action = (x = opts.delete(:action); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationResultAction) ? x : ::Io::Flow::V0::Models::AuthorizationResultAction.from_json(x))) @decline_code = (x = opts.delete(:decline_code); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationDeclineCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeclineCode.apply(x))) @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))) @three_d_secure = (x = opts.delete(:three_d_secure); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ThreeDSecure) ? x : ::Io::Flow::V0::Models::ThreeDSecure.new(x))) @description = (x = opts.delete(:description); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationResultDescription) ? x : ::Io::Flow::V0::Models::AuthorizationResultDescription.new(x))) end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def action @action end |
#avs ⇒ Object (readonly)
Returns the value of attribute avs.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def avs @avs end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def cvv @cvv end |
#decline_code ⇒ Object (readonly)
Returns the value of attribute decline_code.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def decline_code @decline_code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def description @description end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def status @status end |
#three_d_secure ⇒ Object (readonly)
Returns the value of attribute three_d_secure.
20722 20723 20724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20722 def three_d_secure @three_d_secure end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20740 20741 20742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20740 def copy(incoming={}) AuthorizationResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20744 def to_hash { :status => status.value, :action => action.nil? ? nil : action.to_hash, :decline_code => decline_code.nil? ? nil : decline_code.value, :avs => avs.nil? ? nil : avs.to_hash, :cvv => cvv.nil? ? nil : cvv.to_hash, :three_d_secure => three_d_secure.nil? ? nil : three_d_secure.to_hash, :description => description.nil? ? nil : description.to_hash } end |
#to_json ⇒ Object
20736 20737 20738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20736 def to_json JSON.dump(to_hash) end |