class ShopifyAPI::Order

Public Instance Methods

cancel(options = {}) click to toggle source
# File lib/shopify_api/resources/order.rb, line 15
def cancel(options = {})
  load_attributes_from_response(post(:cancel, {}, options.to_json))
end
capture(amount = "", currency: nil) click to toggle source
# File lib/shopify_api/resources/order.rb, line 23
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() click to toggle source
# File lib/shopify_api/resources/order.rb, line 7
def close
  load_attributes_from_response(post(:close, {}, only_id))
end
fulfillment_orders(options = {}) click to toggle source
# File lib/shopify_api/resources/order.rb, line 34
def fulfillment_orders(options = {})
  ShopifyAPI::Base.version_validation!(FulfillmentOrder::MINIMUM_VERSION)

  fulfillment_order_hashes = get(:fulfillment_orders, options)
  fulfillment_order_hashes.map { |fulfillment_order_hash| FulfillmentOrder.new(fulfillment_order_hash) }
end
open() click to toggle source
# File lib/shopify_api/resources/order.rb, line 11
def open
  load_attributes_from_response(post(:open, {}, only_id))
end
transactions() click to toggle source
# File lib/shopify_api/resources/order.rb, line 19
def transactions
  Transaction.find(:all, params: { order_id: id })
end