Module: Vindi::Rest::Bill
- Included in:
- Vindi::Rest
- Defined in:
- lib/vindi/rest/bill.rb
Overview
Methods for the bills API
Instance Method Summary collapse
-
#approve_bill(bill_id, options = {}) ⇒ Object
Approve a bill.
-
#bill(bill_id, options = {}) ⇒ Hash
Get a single bill from a merchant.
-
#charge_bill(bill_id, options = {}) ⇒ Object
Charge a bill.
-
#create_bill(options = {}) ⇒ Hash
Create a bill for a merchant vindi.
-
#create_invoice_from_bill(bill_id, options = {}) ⇒ Object
Generate invoice from a bill.
-
#delete_bill(bill_id, options = {}) ⇒ Object
Delete a bill from merchant vindi.
-
#list_bills(options = {}) ⇒ Array<Hash>
List bill for the authenticate user.
-
#update_bill(bill_id, options = {}) ⇒ Object
Edit a bill.
Instance Method Details
#approve_bill(bill_id, options = {}) ⇒ Object
Approve a bill
56 57 58 |
# File 'lib/vindi/rest/bill.rb', line 56 def approve_bill(bill_id, = {}) post("bills/#{bill_id}/approve", )[:bill] end |
#bill(bill_id, options = {}) ⇒ Hash
Get a single bill from a merchant
22 23 24 |
# File 'lib/vindi/rest/bill.rb', line 22 def bill(bill_id, = {}) get("bills/#{bill_id}", )[:bill] end |
#charge_bill(bill_id, options = {}) ⇒ Object
Charge a bill
67 68 69 |
# File 'lib/vindi/rest/bill.rb', line 67 def charge_bill(bill_id, = {}) post("bills/#{bill_id}/charge", )[:bill] end |
#create_bill(options = {}) ⇒ Hash
Create a bill for a merchant vindi
34 35 36 |
# File 'lib/vindi/rest/bill.rb', line 34 def create_bill( = {}) post('bills', )[:bill] end |
#create_invoice_from_bill(bill_id, options = {}) ⇒ Object
Generate invoice from a bill
78 79 80 |
# File 'lib/vindi/rest/bill.rb', line 78 def create_invoice_from_bill(bill_id, = {}) post("bills/#{bill_id}/invoice", )[:invoices] end |
#delete_bill(bill_id, options = {}) ⇒ Object
Delete a bill from merchant vindi
90 91 92 |
# File 'lib/vindi/rest/bill.rb', line 90 def delete_bill(bill_id, = {}) delete("bills/#{bill_id}", )[:bill] end |
#list_bills(options = {}) ⇒ Array<Hash>
List bill for the authenticate user
11 12 13 |
# File 'lib/vindi/rest/bill.rb', line 11 def list_bills( = {}) get('bills', )[:bills] end |
#update_bill(bill_id, options = {}) ⇒ Object
Edit a bill
45 46 47 |
# File 'lib/vindi/rest/bill.rb', line 45 def update_bill(bill_id, = {}) put("bills/#{bill_id}", )[:bill] end |