Class: Workarea::Orderbot::Order
- Inherits:
-
Object
- Object
- Workarea::Orderbot::Order
- Defined in:
- app/services/workarea/orderbot/order.rb,
app/services/workarea/orderbot/order/item.rb,
app/services/workarea/orderbot/order/tender/general.rb,
app/services/workarea/orderbot/order/tender/gift_card.rb,
app/services/workarea/orderbot/order/tender/credit_card.rb,
app/services/workarea/orderbot/order/tender/store_credit.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
-
#initialize(order_id) ⇒ Order
constructor
A new instance of Order.
- #to_a ⇒ Object
Constructor Details
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
4 5 6 |
# File 'app/services/workarea/orderbot/order.rb', line 4 def order @order end |
Instance Method Details
#to_a ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/workarea/orderbot/order.rb', line 11 def to_a [ { reference_order_id: order.id, order_date: order.placed_at.iso8601, order_status: "unshipped", orderbot_account_id: orderbot_customer_id, # account and customer ids are the same orderbot_customer_id: orderbot_customer_id, reference_account_id: reference_customer_id, reference_customer_id: reference_customer_id, distribution_center_id: Workarea.config.inventory_distribution_center_id, order_guide_id: Workarea.config.default_order_guide_id, email_confirmation_address: order.email, subtotal: subtotal, order_discount: discount_amount, order_total: order.total_price.to_f, shipping_info: shipping_info, ship_to: shipping_address, billing_to: billing_address, order_items: items, payments: payments, taxes: taxes } ] end |