Skip to content

Commit 2f3e706

Browse files
authored
Merge pull request #122 from pedelman/update_orders
Update order resource and examples
2 parents 194e8b5 + 2704ca2 commit 2f3e706

12 files changed

+122
-120
lines changed

examples/orders/order.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
products: [
3333
{
34-
product_id: 34,
34+
product_id: 5,
3535
quantity: 2
3636
}
3737
]

examples/orders/order_coupon.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
config.access_token = ENV['BC_ACCESS_TOKEN']
77
end
88

9-
@order = Bigcommerce::Order.all[0]
9+
@order = Bigcommerce::Order.find(104)
1010

1111
# List order coupons
1212
@order_coupons = Bigcommerce::OrderCoupon.all(@order.id)

examples/orders/order_message.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
config.access_token = ENV['BC_ACCESS_TOKEN']
77
end
88

9-
@order = Bigcommerce::Order.all[0]
9+
@order = Bigcommerce::Order.find(104)
1010

1111
# List order messages
1212
@order_messages = Bigcommerce::OrderMessage.all(@order.id)

examples/orders/order_product.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
config.access_token = ENV['BC_ACCESS_TOKEN']
77
end
88

9-
@order = Bigcommerce::Order.all[0]
9+
@order = Bigcommerce::Order.find(104)
1010

1111
# List order products
1212
@order_products = Bigcommerce::OrderProduct.all(@order.id)

examples/orders/order_tax.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
config.access_token = ENV['BC_ACCESS_TOKEN']
77
end
88

9-
@order = Bigcommerce::Order.find(109)
9+
@order = Bigcommerce::Order.find(110)
1010

1111
# List order taxes
1212
@order_taxes = Bigcommerce::OrderTax.all(@order.id)

lib/bigcommerce/resources/orders/order.rb

+46-44
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,66 @@ class Order < Resource
77
include Bigcommerce::ResourceActions.new uri: 'orders/%d'
88

99
property :id
10-
property :count
10+
property :status
11+
property :coupons
12+
property :products
13+
property :status_id
14+
property :total_tax
15+
property :ip_address
16+
property :is_deleted
17+
property :currency_id
1118
property :customer_id
19+
property :items_total
20+
property :staff_notes
1221
property :date_created
13-
property :date_modified
1422
property :date_shipped
15-
property :status_id
16-
property :status
17-
property :subtotal_ex_tax
18-
property :subtotal_inc_tax
23+
property :order_source
1924
property :subtotal_tax
20-
property :base_shipping_cost
21-
property :shipping_cost_ex_tax
22-
property :shipping_cost_inc_tax
23-
property :shipping_cost_tax
24-
property :shipping_cost_tax_class_id
25-
property :base_handling_cost
26-
property :handling_cost_ex_tax
27-
property :handling_cost_inc_tax
28-
property :handling_cost_tax
29-
property :handling_cost_tax_class_id
30-
property :base_wrapping_cost
31-
property :wrapping_cost_ex_tax
32-
property :wrapping_cost_inc_tax
33-
property :wrapping_cost_tax
34-
property :wrapping_cost_tax_class_id
3525
property :total_ex_tax
36-
property :total_inc_tax
37-
property :total_tax
38-
property :items_total
26+
property :currency_code
27+
property :date_modified
28+
property :ebay_order_id
29+
property :geoip_country
3930
property :items_shipped
31+
property :total_inc_tax
4032
property :payment_method
41-
property :payment_provider_id
4233
property :payment_status
34+
property :billing_address
35+
property :coupon_discount
36+
property :discount_amount
37+
property :external_source
38+
property :is_email_opt_in
4339
property :refunded_amount
40+
property :subtotal_ex_tax
41+
property :credit_card_type
42+
property :customer_message
4443
property :order_is_digital
45-
property :store_credit_amount
46-
property :gift_certificate_amount
47-
property :ip_address
48-
property :geoip_country
44+
property :subtotal_inc_tax
45+
property :handling_cost_tax
46+
property :shipping_cost_tax
47+
property :wrapping_cost_tax
48+
property :base_handling_cost
49+
property :base_shipping_cost
50+
property :base_wrapping_cost
4951
property :geoip_country_iso2
50-
property :currency_id
51-
property :currency_code
52-
property :currency_exchange_rate
52+
property :shipping_addresses
5353
property :default_currency_id
54+
property :payment_provider_id
55+
property :store_credit_amount
56+
property :handling_cost_ex_tax
57+
property :shipping_cost_ex_tax
58+
property :wrapping_cost_ex_tax
5459
property :default_currency_code
55-
property :staff_notes
56-
property :customer_message
57-
property :discount_amount
58-
property :coupon_discount
60+
property :handling_cost_inc_tax
61+
property :shipping_cost_inc_tax
62+
property :wrapping_cost_inc_tax
63+
property :currency_exchange_rate
5964
property :shipping_address_count
60-
property :is_deleted
61-
property :ebay_order_id
62-
property :billing_address
63-
property :order_source
64-
property :external_source
65-
property :products
66-
property :shipping_addresses
67-
property :coupons
65+
property :gift_certificate_amount
66+
property :handling_cost_tax_class_id
67+
property :shipping_cost_tax_class_id
68+
property :wrapping_cost_tax_class_id
69+
property :count
6870

6971
def self.count(params = {})
7072
get 'orders/count', params

lib/bigcommerce/resources/orders/order_coupon.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ class OrderCoupon < Resource
1010
)
1111

1212
property :id
13-
property :coupon_id
14-
property :order_id
1513
property :code
16-
property :amount
17-
property :type
1814
property :type
15+
property :amount
1916
property :discount
17+
property :order_id
18+
property :coupon_id
2019
end
2120
end

lib/bigcommerce/resources/orders/order_message.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class OrderMessage < Resource
1010
)
1111

1212
property :id
13-
property :order_id
14-
property :staff_id
15-
property :customer_id
1613
property :type
17-
property :subject
18-
property :message
1914
property :status
15+
property :message
16+
property :subject
17+
property :customer
18+
property :order_id
19+
property :staff_id
2020
property :is_flagged
21+
property :customer_id
2122
property :date_created
22-
property :customer
2323
end
2424
end

lib/bigcommerce/resources/orders/order_product.rb

+31-31
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,49 @@ class OrderProduct < Resource
1010
)
1111

1212
property :id
13-
property :order_id
14-
property :product_id
15-
property :order_address_id
16-
property :name
1713
property :sku
14+
property :name
1815
property :type
19-
property :count
20-
property :base_price
21-
property :price_ex_tax
22-
property :price_inc_tax
16+
property :weight
17+
property :order_id
18+
property :quantity
2319
property :price_tax
20+
property :return_id
21+
property :total_tax
22+
property :base_price
2423
property :base_total
24+
property :event_date
25+
property :event_name
26+
property :product_id
27+
property :is_refunded
28+
property :ebay_item_id
29+
property :price_ex_tax
2530
property :total_ex_tax
31+
property :option_set_id
32+
property :price_inc_tax
33+
property :refund_amount
2634
property :total_inc_tax
27-
property :total_tax
28-
property :weight
29-
property :quantity
35+
property :wrapping_name
36+
property :cost_price_tax
3037
property :base_cost_price
31-
property :cost_price_inc_tax
38+
property :product_options
39+
property :order_address_id
40+
property :quantity_shipped
41+
property :wrapping_message
42+
property :applied_discounts
3243
property :cost_price_ex_tax
33-
property :cost_price_tax
34-
property :is_refunded
35-
property :refund_amount
36-
property :return_id
37-
property :wrapping_name
44+
property :wrapping_cost_tax
3845
property :base_wrapping_cost
46+
property :bin_picking_number
47+
property :cost_price_inc_tax
48+
property :configurable_fields
49+
property :ebay_transaction_id
50+
property :fixed_shipping_cost
51+
property :is_bundled_product
3952
property :wrapping_cost_ex_tax
4053
property :wrapping_cost_inc_tax
41-
property :wrapping_cost_tax
42-
property :wrapping_message
43-
property :quantity_shipped
44-
property :event_name
45-
property :event_date
46-
property :fixed_shipping_cost
47-
property :ebay_item_id
48-
property :ebay_transaction_id
49-
property :option_set_id
5054
property :parent_order_product_id
51-
property :is_bundled_product, from: :'is_bundled_product '
52-
property :bin_picking_number
53-
property :applied_discounts
54-
property :product_options
55-
property :configurable_fields
55+
property :count
5656

5757
def self.count(order_id)
5858
get "orders/#{order_id}/products/count"

lib/bigcommerce/resources/orders/order_shipping_address.rb

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ class OrderShippingAddress < Resource
1010
)
1111

1212
property :id
13-
property :order_id
14-
property :count
15-
property :first_name
16-
property :last_name
17-
property :company
18-
property :street_1
19-
property :street_2
20-
property :city
2113
property :zip
22-
property :country
23-
property :country_iso2
24-
property :state
14+
property :city
2515
property :email
2616
property :phone
27-
property :items_total
28-
property :items_shipped
29-
property :shipping_method
17+
property :state
18+
property :company
19+
property :country
20+
property :cost_tax
21+
property :order_id
22+
property :street_1
23+
property :street_2
3024
property :base_cost
25+
property :last_name
26+
property :first_name
3127
property :cost_ex_tax
28+
property :items_total
3229
property :cost_inc_tax
33-
property :cost_tax
30+
property :country_iso2
31+
property :items_shipped
32+
property :shipping_method
33+
property :shipping_zone_id
3434
property :cost_tax_class_id
35+
property :handling_cost_tax
3536
property :base_handling_cost
37+
property :shipping_zone_name
3638
property :handling_cost_ex_tax
3739
property :handling_cost_inc_tax
38-
property :handling_cost_tax
3940
property :handling_cost_tax_class_id
40-
property :shipping_zone_id
41-
property :shipping_zone_name
41+
property :count
4242

4343
def self.count(order_id)
4444
get "orders/#{order_id}/shipping_addresses/count"

lib/bigcommerce/resources/orders/order_tax.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class OrderTax < Resource
1010
)
1111

1212
property :id
13-
property :order_id
14-
property :order_address_id
15-
property :tax_rate_id
16-
property :tax_class_id
1713
property :name
18-
property :tax_class, from: :class
1914
property :rate
15+
property :tax_class, from: :class
16+
property :order_id
2017
property :priority
21-
property :priority_amount
2218
property :line_amount
19+
property :tax_rate_id
20+
property :tax_class_id
21+
property :priority_amount
22+
property :order_address_id
2323
end
2424
end

lib/bigcommerce/resources/orders/shipment.rb

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ class Shipment < Resource
77
include Bigcommerce::SubresourceActions.new uri: 'orders/%d/shipments/%d'
88

99
property :id
10+
property :items
11+
property :comments
1012
property :order_id
11-
property :count
1213
property :customer_id
13-
property :order_address_id
1414
property :date_created
15-
property :tracking_number
16-
property :shipping_method
17-
property :comments
1815
property :billing_address
16+
property :shipping_method
17+
property :tracking_number
18+
property :order_address_id
1919
property :shipping_address
20-
property :items
20+
property :shipping_provider
21+
property :count
2122

2223
def self.count(order_id)
2324
get "orders/#{order_id}/shipments/count"

0 commit comments

Comments
 (0)