Class: FacebookCommerce::OrderApi

Inherits:
Api
  • Object
show all
Defined in:
lib/facebook_commerce.rb

Overview

Instance Attribute Summary

Attributes inherited from Api

#access_token, #cms_id, #logger

Instance Method Summary collapse

Methods inherited from Api

#initialize

Constructor Details

This class inherits a constructor from FacebookCommerce::Api

Instance Method Details

#get_order_details(order_id, params = {}) ⇒ Object

Parameters:

  • order_id (String)
  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • fields (String)

    Comma-separated list of fields to include in the response



108
109
110
# File 'lib/facebook_commerce.rb', line 108

def get_order_details(order_id, params = {})
  get(order_id, params)
end

#list_orders(params = {}) ⇒ Object

By default the list_orders method will return orders in the CREATED state. state The state of the order. The default is CREATED. FB_PROCESSING, IN_PROGRESS, COMPLETED

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • updated_before (String)

    Unix timestamp

  • updated_after (String)

    Unix timestamp



102
103
104
# File 'lib/facebook_commerce.rb', line 102

def list_orders(params = {})
  get("#{cms_id}/commerce_orders", params).fetch('data')
end