Class: Billrb::Invoice
- Extended by:
- Operations::Archive, Operations::Create, Operations::List, Operations::Replace, Operations::Retrieve, Operations::Update
- Defined in:
- lib/billrb/resources/invoice.rb
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
-
.payment_link(id, params = {}, options = {}) ⇒ Object
POST /v3/invoices/Resource#id/payment-link — returns a payment link the customer can use to pay the invoice.
-
.record_payment(params, options = {}) ⇒ Object
POST /v3/invoices/record-payment — records a payment received outside BILL (cash, check, …) and applies it to one or more invoices.
-
.send_email(id, params = {}, options = {}) ⇒ Object
POST /v3/invoices/Resource#id/email — emails the invoice (with PDF attached) to the customer, e.g.
Methods included from Operations::List
Methods included from Operations::Retrieve
Methods included from Operations::Create
Methods included from Operations::Update
Methods included from Operations::Replace
Methods included from Operations::Archive
Methods inherited from Resource
#[], #id, #initialize, #inspect, #method_missing, #respond_to_missing?, #to_h
Constructor Details
This class inherits a constructor from Billrb::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Billrb::Resource
Class Method Details
.payment_link(id, params = {}, options = {}) ⇒ Object
POST /v3/invoices/Resource#id/payment-link — returns a payment link the customer can use to pay the invoice.
23 24 25 26 |
# File 'lib/billrb/resources/invoice.rb', line 23 def self.payment_link(id, params = {}, = {}) Resource.new(Operations.client_from().post("#{resource_path}/#{id}/payment-link", Util.camelize_keys(params))) end |
.record_payment(params, options = {}) ⇒ Object
POST /v3/invoices/record-payment — records a payment received outside BILL (cash, check, …) and applies it to one or more invoices.
30 31 32 33 34 |
# File 'lib/billrb/resources/invoice.rb', line 30 def self.record_payment(params, = {}) ReceivablePayment.new(Operations.client_from().post( "#{resource_path}/record-payment", Util.camelize_keys(params), )) end |
.send_email(id, params = {}, options = {}) ⇒ Object
POST /v3/invoices/Resource#id/email — emails the invoice (with PDF attached) to the customer, e.g. send_email(id, recipient: { to: [“a@b.test”] }).
16 17 18 19 |
# File 'lib/billrb/resources/invoice.rb', line 16 def self.send_email(id, params = {}, = {}) Resource.new(Operations.client_from().post("#{resource_path}/#{id}/email", Util.camelize_keys(params))) end |