Class: BigcommerceAPI::Order

Inherits:
Resource show all
Defined in:
lib/bigcommerce_api/order.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#errors

Instance Method Summary collapse

Methods inherited from Resource

all, belongs_to, #create, find, has_many, has_one, #initialize, #parent, #resource, resource, #resource_url, #save

Methods inherited from Base

#attributes, clean!, date_adjust, #initialize, #store, #time, to_rfc2822

Constructor Details

This class inherits a constructor from BigcommerceAPI::Resource

Instance Attribute Details

#base_handling_costObject

Returns the value of attribute base_handling_cost.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def base_handling_cost
  @base_handling_cost
end

#base_shipping_costObject

Returns the value of attribute base_shipping_cost.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def base_shipping_cost
  @base_shipping_cost
end

#base_wrapping_costObject

Returns the value of attribute base_wrapping_cost.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def base_wrapping_cost
  @base_wrapping_cost
end

#billing_addressObject

Returns the value of attribute billing_address.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def billing_address
  @billing_address
end

#coupon_discountObject

Returns the value of attribute coupon_discount.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def coupon_discount
  @coupon_discount
end

#coupons_hashObject

Returns the value of attribute coupons_hash.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def coupons_hash
  @coupons_hash
end

#currency_codeObject

Returns the value of attribute currency_code.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def currency_code
  @currency_code
end

#currency_exchange_rateObject

Returns the value of attribute currency_exchange_rate.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def currency_exchange_rate
  @currency_exchange_rate
end

#currency_idObject

Returns the value of attribute currency_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def currency_id
  @currency_id
end

#customer_idObject

Returns the value of attribute customer_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def customer_id
  @customer_id
end

#customer_messageObject

Returns the value of attribute customer_message.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def customer_message
  @customer_message
end

#date_createdObject

Returns the value of attribute date_created.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def date_created
  @date_created
end

#date_modifiedObject

Returns the value of attribute date_modified.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def date_modified
  @date_modified
end

#date_shippedObject

Returns the value of attribute date_shipped.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def date_shipped
  @date_shipped
end

#default_currency_codeObject

Returns the value of attribute default_currency_code.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def default_currency_code
  @default_currency_code
end

#default_currency_idObject

Returns the value of attribute default_currency_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def default_currency_id
  @default_currency_id
end

#discount_amountObject

Returns the value of attribute discount_amount.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def discount_amount
  @discount_amount
end

#geoip_countryObject

Returns the value of attribute geoip_country.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def geoip_country
  @geoip_country
end

#geoip_country_iso2Object

Returns the value of attribute geoip_country_iso2.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def geoip_country_iso2
  @geoip_country_iso2
end

#gift_certificate_amountObject

Returns the value of attribute gift_certificate_amount.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def gift_certificate_amount
  @gift_certificate_amount
end

#handling_cost_ex_taxObject

Returns the value of attribute handling_cost_ex_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def handling_cost_ex_tax
  @handling_cost_ex_tax
end

#handling_cost_inc_taxObject

Returns the value of attribute handling_cost_inc_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def handling_cost_inc_tax
  @handling_cost_inc_tax
end

#handling_cost_taxObject

Returns the value of attribute handling_cost_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def handling_cost_tax
  @handling_cost_tax
end

#handling_cost_tax_class_idObject

Returns the value of attribute handling_cost_tax_class_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def handling_cost_tax_class_id
  @handling_cost_tax_class_id
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def id
  @id
end

#ip_addressObject

Returns the value of attribute ip_address.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def ip_address
  @ip_address
end

#is_deletedObject

Returns the value of attribute is_deleted.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def is_deleted
  @is_deleted
end

#items_shippedObject

Returns the value of attribute items_shipped.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def items_shipped
  @items_shipped
end

#items_totalObject

Returns the value of attribute items_total.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def items_total
  @items_total
end

#order_is_digitalObject

Returns the value of attribute order_is_digital.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def order_is_digital
  @order_is_digital
end

#payment_methodObject

Returns the value of attribute payment_method.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def payment_method
  @payment_method
end

#payment_provider_idObject

Returns the value of attribute payment_provider_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def payment_provider_id
  @payment_provider_id
end

#payment_statusObject

Returns the value of attribute payment_status.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def payment_status
  @payment_status
end

#products_hashObject

Returns the value of attribute products_hash.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def products_hash
  @products_hash
end

#refunded_amountObject

Returns the value of attribute refunded_amount.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def refunded_amount
  @refunded_amount
end

#shipping_address_countObject

Returns the value of attribute shipping_address_count.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_address_count
  @shipping_address_count
end

#shipping_addresses_hashObject

Returns the value of attribute shipping_addresses_hash.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_addresses_hash
  @shipping_addresses_hash
end

#shipping_cost_ex_taxObject

Returns the value of attribute shipping_cost_ex_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_cost_ex_tax
  @shipping_cost_ex_tax
end

#shipping_cost_inc_taxObject

Returns the value of attribute shipping_cost_inc_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_cost_inc_tax
  @shipping_cost_inc_tax
end

#shipping_cost_taxObject

Returns the value of attribute shipping_cost_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_cost_tax
  @shipping_cost_tax
end

#shipping_cost_tax_class_idObject

Returns the value of attribute shipping_cost_tax_class_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def shipping_cost_tax_class_id
  @shipping_cost_tax_class_id
end

#staff_notesObject

Returns the value of attribute staff_notes.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def staff_notes
  @staff_notes
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def status
  @status
end

#status_idObject

Returns the value of attribute status_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def status_id
  @status_id
end

#store_credit_amountObject

Returns the value of attribute store_credit_amount.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def store_credit_amount
  @store_credit_amount
end

#subtotal_ex_taxObject

Returns the value of attribute subtotal_ex_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def subtotal_ex_tax
  @subtotal_ex_tax
end

#subtotal_inc_taxObject

Returns the value of attribute subtotal_inc_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def subtotal_inc_tax
  @subtotal_inc_tax
end

#subtotal_taxObject

Returns the value of attribute subtotal_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def subtotal_tax
  @subtotal_tax
end

#total_ex_taxObject

Returns the value of attribute total_ex_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def total_ex_tax
  @total_ex_tax
end

#total_inc_taxObject

Returns the value of attribute total_inc_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def total_inc_tax
  @total_inc_tax
end

#total_taxObject

Returns the value of attribute total_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def total_tax
  @total_tax
end

#wrapping_cost_ex_taxObject

Returns the value of attribute wrapping_cost_ex_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def wrapping_cost_ex_tax
  @wrapping_cost_ex_tax
end

#wrapping_cost_inc_taxObject

Returns the value of attribute wrapping_cost_inc_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def wrapping_cost_inc_tax
  @wrapping_cost_inc_tax
end

#wrapping_cost_taxObject

Returns the value of attribute wrapping_cost_tax.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def wrapping_cost_tax
  @wrapping_cost_tax
end

#wrapping_cost_tax_class_idObject

Returns the value of attribute wrapping_cost_tax_class_id.



4
5
6
# File 'lib/bigcommerce_api/order.rb', line 4

def wrapping_cost_tax_class_id
  @wrapping_cost_tax_class_id
end

Instance Method Details

#shipmentsObject



10
11
12
13
# File 'lib/bigcommerce_api/order.rb', line 10

def shipments
  s = BigcommerceAPI::Base.get '/orders/' + self.id.to_s + '/shipments'
  (s.success? and !s.nil?) ? s.collect{|o| BigcommerceAPI::Shipment.new(o)} : []
end