Class: Io::Flow::V0::Models::OrderRefundSummary

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

Overview

For merchant of record authorizations, we provide a summary of refund information primarily to support customer service workflow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderRefundSummary

Returns a new instance of OrderRefundSummary.



53669
53670
53671
53672
53673
53674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53669

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:currency, :amounts], 'OrderRefundSummary')
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
  @amounts = (x = opts.delete(:amounts); x.is_a?(::Io::Flow::V0::Models::OrderRefundSummaryAmounts) ? x : ::Io::Flow::V0::Models::OrderRefundSummaryAmounts.new(x))
end

Instance Attribute Details

#amountsObject (readonly)

Returns the value of attribute amounts.



53667
53668
53669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53667

def amounts
  @amounts
end

#currencyObject (readonly)

Returns the value of attribute currency.



53667
53668
53669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53667

def currency
  @currency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53680
53681
53682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53680

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

#to_hashObject



53684
53685
53686
53687
53688
53689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53684

def to_hash
  {
    :currency => currency,
    :amounts => amounts.to_hash
  }
end

#to_jsonObject



53676
53677
53678
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53676

def to_json
  JSON.dump(to_hash)
end