Class: EwayRapid::DirectRefundRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/entities/direct_refund_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#customerObject

Returns the value of attribute customer.



3
4
5
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 3

def customer
  @customer
end

#customer_ipObject

Returns the value of attribute customer_ip.



9
10
11
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 9

def customer_ip
  @customer_ip
end

#device_idObject

Returns the value of attribute device_id.



8
9
10
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 8

def device_id
  @device_id
end

#line_itemsObject

Returns the value of attribute line_items.



6
7
8
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 6

def line_items
  @line_items
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 7

def options
  @options
end

#partner_idObject

Returns the value of attribute partner_id.



10
11
12
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 10

def partner_id
  @partner_id
end

#refundObject

Returns the value of attribute refund.



5
6
7
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 5

def refund
  @refund
end

#shipping_addressObject

Returns the value of attribute shipping_address.



4
5
6
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 4

def shipping_address
  @shipping_address
end

Instance Method Details

#to_json(opts = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/eway_rapid/entities/direct_refund_request.rb', line 12

def to_json(opts={})
  {
      Constants::CUSTOMER           => InternalModels::Customer.to_hash(customer),
      Constants::SHIPPING_ADDRESS   => InternalModels::ShippingAddress.to_hash(shipping_address),
      Constants::REFUND             => InternalModels::RefundDetails.to_hash(refund),
      Constants::LINE_ITEMS         => Models::LineItem.to_array(line_items),
      Constants::OPTIONS            => InternalModels::Option.to_array(options),
      Constants::DEVICE_ID          => device_id,
      Constants::CUSTOMER_DEVICE_IP => customer_ip,
      Constants::PARTNER_ID         => partner_id
  }.to_json
end