Class: Polar::Order

Inherits:
Resource
  • Object
show all
Defined in:
lib/polar/resources/order.rb

Class Method Summary collapse

Methods inherited from Resource

handle_list, handle_none, handle_one

Class Method Details

.get(id) ⇒ Object



10
11
12
13
# File 'lib/polar/resources/order.rb', line 10

def self.get(id)
  response = Client.get_request("/v1/orders/#{id}")
  handle_one(response)
end

.get_invoice(id) ⇒ Object



15
16
17
18
# File 'lib/polar/resources/order.rb', line 15

def self.get_invoice(id)
  response = Client.get_request("/v1/orders/#{id}/invoice")
  handle_one(response, Invoice)
end

.list(params = {}) ⇒ Object



5
6
7
8
# File 'lib/polar/resources/order.rb', line 5

def self.list(params = {})
  response = Client.get_request("/v1/orders", **params)
  handle_list(response)
end