Class: Belvo::TaxDeclaration
- Defined in:
- lib/belvo/resources.rb
Overview
A Tax declaration is the representation of the tax declaration document sent every year by a person or a business to the tax authority in the country.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(session) ⇒ TaxDeclaration
constructor
A new instance of TaxDeclaration.
-
#retrieve(link:, year_from:, year_to:, options: nil) ⇒ Hash
Retrieve tax declaration information for a specific fiscal link.
Methods inherited from Resource
#clean, #delete, #detail, #list, #resume
Constructor Details
#initialize(session) ⇒ TaxDeclaration
Returns a new instance of TaxDeclaration.
490 491 492 493 |
# File 'lib/belvo/resources.rb', line 490 def initialize(session) super(session) @endpoint = 'api/tax-declarations/' end |
Instance Method Details
#retrieve(link:, year_from:, year_to:, options: nil) ⇒ Hash
Retrieve tax declaration information for a specific fiscal link.
502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/belvo/resources.rb', line 502 def retrieve(link:, year_from:, year_to:, options: nil) = TaxDeclarationOptions.from() body = { link: link, year_from: year_from, year_to: year_to, token: .token, save_data: .save_data || true, attach_pdf: .attach_pdf }.merge() body = clean body: body @session.post(@endpoint, body) end |