Class: Billingrails::Resources::Orders
- Inherits:
-
Object
- Object
- Billingrails::Resources::Orders
- Defined in:
- lib/billingrails/resources/orders.rb
Overview
Orders resource
Instance Method Summary collapse
-
#cancel(id) ⇒ Hash
Cancel an order.
-
#create(data) ⇒ Hash
Create an order.
-
#initialize(client) ⇒ Orders
constructor
A new instance of Orders.
-
#list(params: nil) ⇒ Hash
List orders.
-
#retrieve(id, params: nil) ⇒ Hash
Retrieve an order.
-
#update(id, data) ⇒ Hash
Update an order.
Constructor Details
#initialize(client) ⇒ Orders
Returns a new instance of Orders.
10 11 12 |
# File 'lib/billingrails/resources/orders.rb', line 10 def initialize(client) @client = client end |
Instance Method Details
#cancel(id) ⇒ Hash
Cancel an order
Cancels an order.
20 21 22 23 |
# File 'lib/billingrails/resources/orders.rb', line 20 def cancel(id) path = "/seller/orders/#{id}/cancel" @client.request(:post, path) end |
#create(data) ⇒ Hash
Create an order
Creates an order.
66 67 68 69 |
# File 'lib/billingrails/resources/orders.rb', line 66 def create(data) path = "/seller/orders" @client.request(:post, path, body: data) end |
#list(params: nil) ⇒ Hash
List orders
Retrieves a list of orders.
55 56 57 58 |
# File 'lib/billingrails/resources/orders.rb', line 55 def list(params: nil) path = "/seller/orders" @client.request(:get, path, params: params) end |
#retrieve(id, params: nil) ⇒ Hash
Retrieve an order
Retrieves an order by ID.
32 33 34 35 |
# File 'lib/billingrails/resources/orders.rb', line 32 def retrieve(id, params: nil) path = "/seller/orders/#{id}" @client.request(:get, path, params: params) end |
#update(id, data) ⇒ Hash
Update an order
Updates an order.
44 45 46 47 |
# File 'lib/billingrails/resources/orders.rb', line 44 def update(id, data) path = "/seller/orders/#{id}" @client.request(:put, path, body: data) end |