Class: Io::Flow::V0::Models::PaymentAuthorizationStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentAuthorizationStatus
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentAuthorizationStatus
constructor
A new instance of PaymentAuthorizationStatus.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentAuthorizationStatus
Returns a new instance of PaymentAuthorizationStatus.
50095 50096 50097 50098 50099 50100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50095 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status], 'PaymentAuthorizationStatus') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AuthorizationStatus) ? x : ::Io::Flow::V0::Models::AuthorizationStatus.apply(x)) @reason = (x = opts.delete(:reason); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationDeclineCode) ? x : ::Io::Flow::V0::Models::AuthorizationDeclineCode.apply(x))) end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
50093 50094 50095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50093 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
50093 50094 50095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50093 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50106 50107 50108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50106 def copy(incoming={}) PaymentAuthorizationStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50110 50111 50112 50113 50114 50115 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50110 def to_hash { :status => status.value, :reason => reason.nil? ? nil : reason.value } end |
#to_json ⇒ Object
50102 50103 50104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50102 def to_json JSON.dump(to_hash) end |