Class: Carousel::Order

Inherits:
Request show all
Defined in:
lib/carousel/order.rb

Constant Summary collapse

PATH =
"?action=order"

Instance Method Summary collapse

Methods inherited from Request

#build_user, #construct_xml, #initialize

Constructor Details

This class inherits a constructor from Carousel::Request

Instance Method Details

#build_order_request(order) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/carousel/order.rb', line 6

def build_order_request(order)
  construct_xml "orders" do |xml|

    xml.order do

      build_user xml

      xml.customerref    order[:number]
      xml.ordernumber    order[:number]
      xml.shippingmethod Shipping.map(order[:shipping_method])
      xml.giftnote       order[:gift_message] unless order[:gift_message].nil?

      build_address xml, order[:shipping_address], :shipping
      build_address xml, order[:billing_address], :billing
      build_line_items xml, order

    end

  end
end