Class: Alegra::Payments
Instance Attribute Summary
Attributes inherited from Record
Instance Method Summary collapse
-
#create(params) ⇒ Hash
Creates a payment.
- #delete(id) ⇒ Hash
- #find(id) ⇒ Hash
-
#list(params = {}) ⇒ Array
Returs all payments.
-
#update(id, params) ⇒ Hash
Update a payment.
Methods inherited from Record
Constructor Details
This class inherits a constructor from Alegra::Record
Instance Method Details
#create(params) ⇒ Hash
Creates a payment
38 39 40 41 |
# File 'lib/alegra/payments.rb', line 38 def create(params) sanitize_params = params.deep_camel_case_lower_keys client.post('payments', sanitize_params) end |
#delete(id) ⇒ Hash
66 67 68 |
# File 'lib/alegra/payments.rb', line 66 def delete(id) client.delete("payments/#{id}") end |
#find(id) ⇒ Hash
5 6 7 |
# File 'lib/alegra/payments.rb', line 5 def find(id) client.get("payments/#{id}") end |
#list(params = {}) ⇒ Array
Returs all payments
19 20 21 |
# File 'lib/alegra/payments.rb', line 19 def list(params = {}) client.get('payments', params) end |
#update(id, params) ⇒ Hash
Update a payment
59 60 61 62 |
# File 'lib/alegra/payments.rb', line 59 def update(id, params) sanitize_params = params.deep_camel_case_lower_keys client.put("payments/#{id}", sanitize_params) end |