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.



31240
31241
31242
31243
31244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31240

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.



31238
31239
31240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31238

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31250
31251
31252
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31250

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

#to_hashObject



31254
31255
31256
31257
31258
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31254

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

#to_jsonObject



31246
31247
31248
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31246

def to_json
  JSON.dump(to_hash)
end