Class: Io::Flow::V0::Models::PaymentReversalStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentReversalStatus

Returns a new instance of PaymentReversalStatus.



59039
59040
59041
59042
59043
59044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59039

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:status], 'PaymentReversalStatus')
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ReversalStatus) ? x : ::Io::Flow::V0::Models::ReversalStatus.apply(x))
  @reason = (x = opts.delete(:reason); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ReversalErrorCode) ? x : ::Io::Flow::V0::Models::ReversalErrorCode.apply(x)))
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



59037
59038
59039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59037

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



59037
59038
59039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59037

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59050
59051
59052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59050

def copy(incoming={})
  PaymentReversalStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



59054
59055
59056
59057
59058
59059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59054

def to_hash
  {
    :status => status.value,
    :reason => reason.nil? ? nil : reason.value
  }
end

#to_jsonObject



59046
59047
59048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59046

def to_json
  JSON.dump(to_hash)
end