Class: Dolibarr::Api::Supplierinvoices::Payments
- Inherits:
-
Object
- Object
- Dolibarr::Api::Supplierinvoices::Payments
- Defined in:
- lib/dolibarr-api/api/supplierinvoices/payments.rb
Instance Method Summary collapse
- #create(id:, supplierinvoices_add_payment_model:) ⇒ Object
-
#initialize(connection) ⇒ Payments
constructor
A new instance of Payments.
- #list(id:) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Payments
Returns a new instance of Payments.
5 6 7 |
# File 'lib/dolibarr-api/api/supplierinvoices/payments.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#create(id:, supplierinvoices_add_payment_model:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dolibarr-api/api/supplierinvoices/payments.rb', line 9 def create(id:, supplierinvoices_add_payment_model:) raise ArgumentError, 'id is required' if id.nil? raise ArgumentError, 'supplierinvoices_add_payment_model is required' if supplierinvoices_add_payment_model.nil? @connection.call( :POST, '/supplierinvoices/{id}/payments' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'], body: supplierinvoices_add_payment_model ) end |
#list(id:) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dolibarr-api/api/supplierinvoices/payments.rb', line 23 def list(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :GET, '/supplierinvoices/{id}/payments' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'] ) end |