Class: Io::Flow::V0::Models::EmailNotificationDataRefund

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

Overview

Sends an refund confirmation email to the customer (using the order.customer.email as the recipient).

Instance Attribute Summary collapse

Attributes inherited from EmailNotificationData

#discriminator

Instance Method Summary collapse

Methods inherited from EmailNotificationData

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ EmailNotificationDataRefund

Returns a new instance of EmailNotificationDataRefund.



30513
30514
30515
30516
30517
30518
30519
30520
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30513

def initialize(incoming={})
  super(:discriminator => EmailNotificationData::Types::EMAIL_NOTIFICATION_DATA_REFUND)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order, :return_, :payment], 'EmailNotificationDataRefund')
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderSummary) ? x : ::Io::Flow::V0::Models::OrderSummary.new(x))
  @return_ = (x = opts.delete(:return); x.is_a?(::Io::Flow::V0::Models::OrderSummary) ? x : ::Io::Flow::V0::Models::OrderSummary.new(x))
  @payment = (x = opts.delete(:payment); x.is_a?(::Io::Flow::V0::Models::EmailPaymentSummary) ? x : ::Io::Flow::V0::Models::EmailPaymentSummary.new(x))
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



30511
30512
30513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30511

def order
  @order
end

#paymentObject (readonly)

Returns the value of attribute payment.



30511
30512
30513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30511

def payment
  @payment
end

#return_Object (readonly)

Returns the value of attribute return_.



30511
30512
30513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30511

def return_
  @return_
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30526
30527
30528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30526

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

#subtype_to_hashObject



30530
30531
30532
30533
30534
30535
30536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30530

def subtype_to_hash
  {
    :order => order.to_hash,
    :return => return_.to_hash,
    :payment => payment.to_hash
  }
end

#to_jsonObject



30522
30523
30524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30522

def to_json
  JSON.dump(to_hash)
end