Class: Squall::Payment
Overview
OnApp Payment
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) create(user_id, options = {})
Create a payment for a user.
-
- (Object) delete(user_id, id)
Delete a payment.
-
- (Object) edit(user_id, id, options = {})
Edit a payment.
-
- (Object) list(user_id)
Lists all payments.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) create(user_id, options = {})
Create a payment for a user.
24 25 26 |
# File 'lib/squall/payment.rb', line 24 def create(user_id, = {}) request(:post, "/users/#{user_id}/payments.json", default_params()) end |
- (Object) delete(user_id, id)
Delete a payment
45 46 47 |
# File 'lib/squall/payment.rb', line 45 def delete(user_id, id) request(:delete, "/users/#{user_id}/payments/#{id}.json") end |
- (Object) edit(user_id, id, options = {})
Edit a payment
35 36 37 |
# File 'lib/squall/payment.rb', line 35 def edit(user_id, id, = {}) request(:put, "/users/#{user_id}/payments/#{id}.json", default_params()) end |
- (Object) list(user_id)
Lists all payments.
7 8 9 10 |
# File 'lib/squall/payment.rb', line 7 def list(user_id) response = request(:get, "/users/#{user_id}/payments.json") response.collect { |user| user['payment'] } end |