Skip to content

Instantly share code, notes, and snippets.

@shivabhusal
Last active March 18, 2016 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivabhusal/8c72cc2910339e5304f5 to your computer and use it in GitHub Desktop.
Save shivabhusal/8c72cc2910339e5304f5 to your computer and use it in GitHub Desktop.
Spree Sample orders for developers working with spree
Sample Order
<Spree::Order:0x007fa6d37b52d8
id: 6,
number: "R141192317",
item_total: #<BigDecimal:7fa6d3d37d28,'0.1999E2',18(27)>,
total: #<BigDecimal:7fa6d39816c0,'0.2599E2',18(27)>,
state: "complete",
adjustment_total: #<BigDecimal:7fa6d3d37b48,'0.1E1',9(18)>,
user_id: 4,
completed_at: Thu, 10 Mar 2016 03:24:55 UTC +00:00,
bill_address_id: 5,
ship_address_id: 6,
payment_total: #<BigDecimal:7fa6d3d37940,'0.0',9(18)>,
shipping_method_id: nil,
shipment_state: "pending",
payment_state: "balance_due",
email: "user@example.com",
special_instructions: nil,
created_at: Thu, 10 Mar 2016 03:17:37 UTC +00:00,
updated_at: Thu, 10 Mar 2016 03:24:55 UTC +00:00,
currency: "USD",
last_ip_address: "127.0.0.1",
created_by_id: 4,
shipment_total: #<BigDecimal:7fa6d39819e0,'0.5E1',9(18)>,
additional_tax_total: #<BigDecimal:7fa6d3d37170,'0.1E1',9(18)>,
promo_total: #<BigDecimal:7fa6d3d370a8,'0.0',9(18)>,
channel: "spree",
included_tax_total: #<BigDecimal:7fa6d3d36f90,'0.0',9(18)>,
item_count: 1,
approver_id: nil,
approved_at: nil,
confirmation_delivered: true,
considered_risky: false,
guest_token: "mF2n4nMCm7hXbQ1WUquIFA",
canceled_at: nil,
canceler_id: nil,
store_id: 1,
state_lock_version: 4>
<Spree::Order:0x007fa6d21890b8
id: 7,
number: "R904730587",
item_total: #<BigDecimal:7fa6d030cf18,'0.6597E2',18(27)>,
total: #<BigDecimal:7fa6d29e4c80,'0.7427E2',18(27)>,
state: "confirm",
adjustment_total: #<BigDecimal:7fa6d030cce8,'0.33E1',18(27)>,
user_id: 4,
completed_at: nil,
bill_address_id: 7,
ship_address_id: 8,
payment_total: #<BigDecimal:7fa6d030ca68,'0.0',9(18)>,
shipping_method_id: nil,
shipment_state: nil,
payment_state: nil,
email: "user@example.com",
special_instructions: nil,
created_at: Thu, 10 Mar 2016 03:40:04 UTC +00:00,
updated_at: Thu, 10 Mar 2016 03:42:40 UTC +00:00,
currency: "USD",
last_ip_address: "127.0.0.1",
created_by_id: 4,
shipment_total: #<BigDecimal:7fa6d29e62d8,'0.5E1',9(18)>,
additional_tax_total: #<BigDecimal:7fa6d02ebb10,'0.33E1',18(27)>,
promo_total: #<BigDecimal:7fa6d02eba20,'0.0',9(18)>,
channel: "spree",
included_tax_total: #<BigDecimal:7fa6d02eb7f0,'0.0',9(18)>,
item_count: 3,
approver_id: nil,
approved_at: nil,
confirmation_delivered: false,
considered_risky: false,
guest_token: "mF2n4nMCm7hXbQ1WUquIFA",
canceled_at: nil,
canceler_id: nil,
store_id: 1,
state_lock_version: 3>
## Order when 2 pieces of two items purchased
> @order
=> #<Spree::Order:0x0000000d3f1e18
id: 41,
number: "R035737592",
item_total: #<BigDecimal:dfd22c8,'0.9196E2',18(27)>,
total: #<BigDecimal:ce221e0,'0.10156E3',18(27)>,
state: "complete",
adjustment_total: #<BigDecimal:dfd1ff8,'0.46E1',18(27)>,
user_id: 5,
completed_at: Fri, 18 Mar 2016 09:13:43 UTC +00:00,
bill_address_id: 77,
ship_address_id: 78,
payment_total: #<BigDecimal:dfd1da0,'0.0',9(18)>,
shipping_method_id: nil,
shipment_state: "pending",
payment_state: "balance_due",
email: "hotline.shiva+father1@gmail.com",
special_instructions: nil,
created_at: Fri, 18 Mar 2016 09:12:11 UTC +00:00,
updated_at: Fri, 18 Mar 2016 09:13:43 UTC +00:00,
currency: "USD",
last_ip_address: "127.0.0.1",
created_by_id: 5,
shipment_total: #<BigDecimal:ce22960,'0.5E1',9(18)>,
additional_tax_total: #<BigDecimal:dfd1490,'0.46E1',18(27)>,
promo_total: #<BigDecimal:dfd1260,'0.0',9(18)>,
channel: "spree",
included_tax_total: #<BigDecimal:dfd10f8,'0.0',9(18)>,
item_count: 4,
approver_id: nil,
approved_at: nil,
confirmation_delivered: true,
considered_risky: false,
guest_token: "3TvZNFEy2jB4xffOARoLqg",
canceled_at: nil,
canceler_id: nil,
store_id: 1,
state_lock_version: 4>
### Line items
> @order.line_items
=> [#<Spree::LineItem:0x0000000c1b7720
id: 47,
variant_id: 2,
order_id: 41,
quantity: 2,
price: #<BigDecimal:d7a0b68,'0.2299E2',18(27)>,
created_at: Fri, 18 Mar 2016 09:12:11 UTC +00:00,
updated_at: Fri, 18 Mar 2016 09:12:42 UTC +00:00,
currency: "USD",
cost_price: #<BigDecimal:ce0ad10,'0.21E2',9(18)>,
tax_category_id: 1,
adjustment_total: #<BigDecimal:c988328,'0.23E1',18(27)>,
additional_tax_total: #<BigDecimal:c6609c0,'0.23E1',18(27)>,
promo_total: #<BigDecimal:d49a400,'0.0',9(18)>,
included_tax_total: #<BigDecimal:dbd03a0,'0.0',9(18)>,
pre_tax_amount: #<BigDecimal:d0640e8,'0.4598E2',18(27)>>,
#<Spree::LineItem:0x0000000c1b73d8
id: 48,
variant_id: 12,
order_id: 41,
quantity: 2,
price: #<BigDecimal:c6912f0,'0.2299E2',18(27)>,
created_at: Fri, 18 Mar 2016 09:12:22 UTC +00:00,
updated_at: Fri, 18 Mar 2016 09:12:42 UTC +00:00,
currency: "USD",
cost_price: #<BigDecimal:c9222d0,'0.21E2',9(18)>,
tax_category_id: 1,
adjustment_total: #<BigDecimal:cd92518,'0.23E1',18(27)>,
additional_tax_total: #<BigDecimal:e14d698,'0.23E1',18(27)>,
promo_total: #<BigDecimal:cb8cb38,'0.0',9(18)>,
included_tax_total: #<BigDecimal:d08fba8,'0.0',9(18)>,
pre_tax_amount: #<BigDecimal:b25e698,'0.4598E2',18(27)>>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment