Class: Workarea::Affirm::Order
- Inherits:
-
Object
- Object
- Workarea::Affirm::Order
- Defined in:
- app/services/workarea/affirm/order.rb
Defined Under Namespace
Modules: ProductImageUrl, ProductUrl
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
-
#initialize(order_id, options = {}) ⇒ Order
constructor
A new instance of Order.
- #to_hash ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options
22 23 24 |
# File 'app/services/workarea/affirm/order.rb', line 22 def @options end |
#order ⇒ Object (readonly)
Returns the value of attribute order
22 23 24 |
# File 'app/services/workarea/affirm/order.rb', line 22 def order @order end |
Instance Method Details
#to_hash ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/services/workarea/affirm/order.rb', line 34 def to_hash { merchant: merchant, shipping: shipping, billing: billing, items: items, order_id: order.id, shipping_amount: order.shipping_total.cents, tax_amount: order.tax_total.cents, total: order.order_balance.cents } end |
#to_json(*_args) ⇒ Object
30 31 32 |
# File 'app/services/workarea/affirm/order.rb', line 30 def to_json(*_args) to_hash.to_json end |