Skip to content

Commit

Permalink
Merge pull request #122 from pedelman/update_orders
Browse files Browse the repository at this point in the history
Update order resource and examples
  • Loading branch information
saurabh-g committed Jun 21, 2016
2 parents 194e8b5 + 2704ca2 commit 2f3e706
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 120 deletions.
2 changes: 1 addition & 1 deletion examples/orders/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
products: [
{
product_id: 34,
product_id: 5,
quantity: 2
}
]
Expand Down
2 changes: 1 addition & 1 deletion examples/orders/order_coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config.access_token = ENV['BC_ACCESS_TOKEN']
end

@order = Bigcommerce::Order.all[0]
@order = Bigcommerce::Order.find(104)

# List order coupons
@order_coupons = Bigcommerce::OrderCoupon.all(@order.id)
Expand Down
2 changes: 1 addition & 1 deletion examples/orders/order_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config.access_token = ENV['BC_ACCESS_TOKEN']
end

@order = Bigcommerce::Order.all[0]
@order = Bigcommerce::Order.find(104)

# List order messages
@order_messages = Bigcommerce::OrderMessage.all(@order.id)
Expand Down
2 changes: 1 addition & 1 deletion examples/orders/order_product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config.access_token = ENV['BC_ACCESS_TOKEN']
end

@order = Bigcommerce::Order.all[0]
@order = Bigcommerce::Order.find(104)

# List order products
@order_products = Bigcommerce::OrderProduct.all(@order.id)
Expand Down
2 changes: 1 addition & 1 deletion examples/orders/order_tax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config.access_token = ENV['BC_ACCESS_TOKEN']
end

@order = Bigcommerce::Order.find(109)
@order = Bigcommerce::Order.find(110)

# List order taxes
@order_taxes = Bigcommerce::OrderTax.all(@order.id)
Expand Down
90 changes: 46 additions & 44 deletions lib/bigcommerce/resources/orders/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,66 @@ class Order < Resource
include Bigcommerce::ResourceActions.new uri: 'orders/%d'

property :id
property :count
property :status
property :coupons
property :products
property :status_id
property :total_tax
property :ip_address
property :is_deleted
property :currency_id
property :customer_id
property :items_total
property :staff_notes
property :date_created
property :date_modified
property :date_shipped
property :status_id
property :status
property :subtotal_ex_tax
property :subtotal_inc_tax
property :order_source
property :subtotal_tax
property :base_shipping_cost
property :shipping_cost_ex_tax
property :shipping_cost_inc_tax
property :shipping_cost_tax
property :shipping_cost_tax_class_id
property :base_handling_cost
property :handling_cost_ex_tax
property :handling_cost_inc_tax
property :handling_cost_tax
property :handling_cost_tax_class_id
property :base_wrapping_cost
property :wrapping_cost_ex_tax
property :wrapping_cost_inc_tax
property :wrapping_cost_tax
property :wrapping_cost_tax_class_id
property :total_ex_tax
property :total_inc_tax
property :total_tax
property :items_total
property :currency_code
property :date_modified
property :ebay_order_id
property :geoip_country
property :items_shipped
property :total_inc_tax
property :payment_method
property :payment_provider_id
property :payment_status
property :billing_address
property :coupon_discount
property :discount_amount
property :external_source
property :is_email_opt_in
property :refunded_amount
property :subtotal_ex_tax
property :credit_card_type
property :customer_message
property :order_is_digital
property :store_credit_amount
property :gift_certificate_amount
property :ip_address
property :geoip_country
property :subtotal_inc_tax
property :handling_cost_tax
property :shipping_cost_tax
property :wrapping_cost_tax
property :base_handling_cost
property :base_shipping_cost
property :base_wrapping_cost
property :geoip_country_iso2
property :currency_id
property :currency_code
property :currency_exchange_rate
property :shipping_addresses
property :default_currency_id
property :payment_provider_id
property :store_credit_amount
property :handling_cost_ex_tax
property :shipping_cost_ex_tax
property :wrapping_cost_ex_tax
property :default_currency_code
property :staff_notes
property :customer_message
property :discount_amount
property :coupon_discount
property :handling_cost_inc_tax
property :shipping_cost_inc_tax
property :wrapping_cost_inc_tax
property :currency_exchange_rate
property :shipping_address_count
property :is_deleted
property :ebay_order_id
property :billing_address
property :order_source
property :external_source
property :products
property :shipping_addresses
property :coupons
property :gift_certificate_amount
property :handling_cost_tax_class_id
property :shipping_cost_tax_class_id
property :wrapping_cost_tax_class_id
property :count

def self.count(params = {})
get 'orders/count', params
Expand Down
7 changes: 3 additions & 4 deletions lib/bigcommerce/resources/orders/order_coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ class OrderCoupon < Resource
)

property :id
property :coupon_id
property :order_id
property :code
property :amount
property :type
property :type
property :amount
property :discount
property :order_id
property :coupon_id
end
end
12 changes: 6 additions & 6 deletions lib/bigcommerce/resources/orders/order_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class OrderMessage < Resource
)

property :id
property :order_id
property :staff_id
property :customer_id
property :type
property :subject
property :message
property :status
property :message
property :subject
property :customer
property :order_id
property :staff_id
property :is_flagged
property :customer_id
property :date_created
property :customer
end
end
62 changes: 31 additions & 31 deletions lib/bigcommerce/resources/orders/order_product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,49 @@ class OrderProduct < Resource
)

property :id
property :order_id
property :product_id
property :order_address_id
property :name
property :sku
property :name
property :type
property :count
property :base_price
property :price_ex_tax
property :price_inc_tax
property :weight
property :order_id
property :quantity
property :price_tax
property :return_id
property :total_tax
property :base_price
property :base_total
property :event_date
property :event_name
property :product_id
property :is_refunded
property :ebay_item_id
property :price_ex_tax
property :total_ex_tax
property :option_set_id
property :price_inc_tax
property :refund_amount
property :total_inc_tax
property :total_tax
property :weight
property :quantity
property :wrapping_name
property :cost_price_tax
property :base_cost_price
property :cost_price_inc_tax
property :product_options
property :order_address_id
property :quantity_shipped
property :wrapping_message
property :applied_discounts
property :cost_price_ex_tax
property :cost_price_tax
property :is_refunded
property :refund_amount
property :return_id
property :wrapping_name
property :wrapping_cost_tax
property :base_wrapping_cost
property :bin_picking_number
property :cost_price_inc_tax
property :configurable_fields
property :ebay_transaction_id
property :fixed_shipping_cost
property :is_bundled_product
property :wrapping_cost_ex_tax
property :wrapping_cost_inc_tax
property :wrapping_cost_tax
property :wrapping_message
property :quantity_shipped
property :event_name
property :event_date
property :fixed_shipping_cost
property :ebay_item_id
property :ebay_transaction_id
property :option_set_id
property :parent_order_product_id
property :is_bundled_product, from: :'is_bundled_product '
property :bin_picking_number
property :applied_discounts
property :product_options
property :configurable_fields
property :count

def self.count(order_id)
get "orders/#{order_id}/products/count"
Expand Down
36 changes: 18 additions & 18 deletions lib/bigcommerce/resources/orders/order_shipping_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ class OrderShippingAddress < Resource
)

property :id
property :order_id
property :count
property :first_name
property :last_name
property :company
property :street_1
property :street_2
property :city
property :zip
property :country
property :country_iso2
property :state
property :city
property :email
property :phone
property :items_total
property :items_shipped
property :shipping_method
property :state
property :company
property :country
property :cost_tax
property :order_id
property :street_1
property :street_2
property :base_cost
property :last_name
property :first_name
property :cost_ex_tax
property :items_total
property :cost_inc_tax
property :cost_tax
property :country_iso2
property :items_shipped
property :shipping_method
property :shipping_zone_id
property :cost_tax_class_id
property :handling_cost_tax
property :base_handling_cost
property :shipping_zone_name
property :handling_cost_ex_tax
property :handling_cost_inc_tax
property :handling_cost_tax
property :handling_cost_tax_class_id
property :shipping_zone_id
property :shipping_zone_name
property :count

def self.count(order_id)
get "orders/#{order_id}/shipping_addresses/count"
Expand Down
12 changes: 6 additions & 6 deletions lib/bigcommerce/resources/orders/order_tax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class OrderTax < Resource
)

property :id
property :order_id
property :order_address_id
property :tax_rate_id
property :tax_class_id
property :name
property :tax_class, from: :class
property :rate
property :tax_class, from: :class
property :order_id
property :priority
property :priority_amount
property :line_amount
property :tax_rate_id
property :tax_class_id
property :priority_amount
property :order_address_id
end
end
13 changes: 7 additions & 6 deletions lib/bigcommerce/resources/orders/shipment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ class Shipment < Resource
include Bigcommerce::SubresourceActions.new uri: 'orders/%d/shipments/%d'

property :id
property :items
property :comments
property :order_id
property :count
property :customer_id
property :order_address_id
property :date_created
property :tracking_number
property :shipping_method
property :comments
property :billing_address
property :shipping_method
property :tracking_number
property :order_address_id
property :shipping_address
property :items
property :shipping_provider
property :count

def self.count(order_id)
get "orders/#{order_id}/shipments/count"
Expand Down

0 comments on commit 2f3e706

Please sign in to comment.