Class: ShopifyAPI::Order

Inherits:
Base show all
Includes:
Events, Metafields
Defined in:
lib/shopify_api/resources/order.rb

Instance Method Summary (collapse)

Methods included from Metafields

#add_metafield, #metafields

Methods included from Events

#events

Methods included from Countable

#count

Methods inherited from ActiveResource::Base

#encode

Instance Method Details

- (Object) cancel(options = {})



9
10
11
# File 'lib/shopify_api/resources/order.rb', line 9

def cancel(options = {})
  load_attributes_from_response(post(:cancel, options, only_id))
end

- (Object) capture(amount = "")



17
18
19
# File 'lib/shopify_api/resources/order.rb', line 17

def capture(amount = "")
  Transaction.create(:amount => amount, :kind => "capture", :order_id => id)
end

- (Object) close



6
# File 'lib/shopify_api/resources/order.rb', line 6

def close;  load_attributes_from_response(post(:close, {}, only_id)); end

- (Object) open



7
# File 'lib/shopify_api/resources/order.rb', line 7

def open;   load_attributes_from_response(post(:open, {}, only_id)); end

- (Object) transactions



13
14
15
# File 'lib/shopify_api/resources/order.rb', line 13

def transactions
  Transaction.find(:all, :params => { :order_id => id })
end