Class: ShopifyAPI::Order

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

Defined Under Namespace

Classes: ClientDetails

Instance Method Summary collapse

Methods included from Metafields

#add_metafield, #metafields

Methods included from Events

#events

Methods inherited from Base

activate_session, #as_json, clear_session, #encode, #headers, init_prefix, init_prefix_explicit, #persisted?

Methods included from Countable

#count

Methods inherited from ActiveResource::Base

delete, headers

Instance Method Details

#cancel(options = {}) ⇒ Object



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

#capture(amount = "") ⇒ Object



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

#closeObject



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

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

#openObject



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

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

#transactionsObject



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

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