Class: ShopifyAPI::Order
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, api_version, api_version=, #as_json, clear_session, early_july_pagination?, #encode, headers, init_prefix, init_prefix_explicit, #persisted?, prefix, prefix=, prefix_source, resource_prefix, resource_prefix=, version_validation!
Methods included from Countable
#count
Instance Method Details
#cancel(options = {}) ⇒ Object
14
15
16
|
# File 'lib/shopify_api/resources/order.rb', line 14
def cancel(options = {})
load_attributes_from_response(post(:cancel, {}, options.to_json))
end
|
#capture(amount = "", currency: nil) ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/shopify_api/resources/order.rb', line 22
def capture(amount = "", currency: nil)
capture_transaction = {
amount: amount,
kind: "capture",
order_id: id,
}
capture_transaction[:currency] = currency if currency
Transaction.create(capture_transaction)
end
|
#close ⇒ Object
6
7
8
|
# File 'lib/shopify_api/resources/order.rb', line 6
def close
load_attributes_from_response(post(:close, {}, only_id))
end
|
#fulfillment_orders(options = {}) ⇒ Object
#open ⇒ Object
10
11
12
|
# File 'lib/shopify_api/resources/order.rb', line 10
def open
load_attributes_from_response(post(:open, {}, only_id))
end
|
#transactions ⇒ Object
18
19
20
|
# File 'lib/shopify_api/resources/order.rb', line 18
def transactions
Transaction.find(:all, params: { order_id: id })
end
|