Class: Io::Flow::V0::Models::EmailPaymentSummary

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

Returns a new instance of EmailPaymentSummary.



29909
29910
29911
29912
29913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29909

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:refund], 'EmailPaymentSummary')
  @refund = (x = opts.delete(:refund); x.is_a?(::Io::Flow::V0::Models::Refund) ? x : ::Io::Flow::V0::Models::Refund.new(x))
end

Instance Attribute Details

#refundObject (readonly)

Returns the value of attribute refund.



29907
29908
29909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29907

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29919
29920
29921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29919

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

#to_hashObject



29923
29924
29925
29926
29927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29923

def to_hash
  {
    :refund => refund.to_hash
  }
end

#to_jsonObject



29915
29916
29917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29915

def to_json
  JSON.dump(to_hash)
end