Class: Mercadopago::Invoice
- Defined in:
- lib/mercadopago/resources/invoice.rb
Overview
Provides read access to subscription invoices (authorized payments).
Each invoice corresponds to a billing cycle of a Preapproval and tracks the charge amount, status, retry attempts, and the resulting payment. Use #get and #search to monitor billing cycles and their outcomes.
Instance Method Summary collapse
-
#get(invoice_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves a single invoice (authorized payment) by its ID.
-
#search(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Searches invoices matching the given filters.
Methods inherited from MPBase
#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize
Constructor Details
This class inherits a constructor from Mercadopago::MPBase
Instance Method Details
#get(invoice_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves a single invoice (authorized payment) by its ID.
21 22 23 |
# File 'lib/mercadopago/resources/invoice.rb', line 21 def get(invoice_id, request_options: nil) _get(uri: "/authorized_payments/#{invoice_id}", request_options: ) end |
#search(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Searches invoices matching the given filters.
34 35 36 37 38 |
# File 'lib/mercadopago/resources/invoice.rb', line 34 def search(filters: nil, request_options: nil) raise TypeError, 'Param filters must be a Hash' unless filters.nil? || filters.is_a?(Hash) _get(uri: '/authorized_payments/search', filters: filters, request_options: ) end |