Class: Io::Flow::V0::Models::PaymentRefundStatus

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 = {}) ⇒ PaymentRefundStatus

Returns a new instance of PaymentRefundStatus.



58574
58575
58576
58577
58578
58579
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58574

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

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



58572
58573
58574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58572

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



58572
58573
58574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58572

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58585
58586
58587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58585

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

#to_hashObject



58589
58590
58591
58592
58593
58594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58589

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

#to_jsonObject



58581
58582
58583
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58581

def to_json
  JSON.dump(to_hash)
end