Class: Billingrails::Resources::Payments
- Inherits:
-
Object
- Object
- Billingrails::Resources::Payments
- Defined in:
- lib/billingrails/resources/payments.rb
Overview
Payments resource
Instance Method Summary collapse
-
#create(data) ⇒ Hash
Create a payment.
-
#initialize(client) ⇒ Payments
constructor
A new instance of Payments.
-
#list(params: nil) ⇒ Hash
List payments.
-
#retrieve(id, params: nil) ⇒ Hash
Retrieve payment.
Constructor Details
#initialize(client) ⇒ Payments
Returns a new instance of Payments.
10 11 12 |
# File 'lib/billingrails/resources/payments.rb', line 10 def initialize(client) @client = client end |
Instance Method Details
#create(data) ⇒ Hash
Create a payment
Create an online or offline payment for an invoice, payment request, or credit grant.
31 32 33 34 |
# File 'lib/billingrails/resources/payments.rb', line 31 def create(data) path = "/payments" @client.request(:post, path, body: data) end |
#list(params: nil) ⇒ Hash
List payments
Retrieves a list of payments.
20 21 22 23 |
# File 'lib/billingrails/resources/payments.rb', line 20 def list(params: nil) path = "/payments" @client.request(:get, path, params: params) end |
#retrieve(id, params: nil) ⇒ Hash
Retrieve payment
Retrieves a payment by ID.
43 44 45 46 |
# File 'lib/billingrails/resources/payments.rb', line 43 def retrieve(id, params: nil) path = "/payments/#{id}" @client.request(:get, path, params: params) end |