Class: Belvo::TaxStatus

Inherits:
Resource show all
Defined in:
lib/belvo/resources.rb

Overview

A Tax status is the representation of the tax situation of a person or a business to the tax authority in the country.

Instance Attribute Summary

Attributes inherited from Resource

#endpoint

Instance Method Summary collapse

Methods inherited from Resource

#clean, #delete, #detail, #list

Constructor Details

#initialize(session) ⇒ TaxStatus

Returns a new instance of TaxStatus.



563
564
565
566
# File 'lib/belvo/resources.rb', line 563

def initialize(session)
  super(session)
  @endpoint = 'api/tax-status/'
end

Instance Method Details

#resume(_session_id, _token, _link: nil) ⇒ Object



585
586
587
588
# File 'lib/belvo/resources.rb', line 585

def resume(_session_id, _token, _link: nil)
  raise NotImplementedError \
    'TaxRetentions does not support resuming a session.'
end

#retrieve(link:, options: nil) ⇒ Hash

Retrieve tax status information from a specific fiscal link.

Parameters:

  • link (String)

    Link UUID

  • options (TaxStatusOptions) (defaults to: nil)

    Configurable properties

Returns:

  • (Hash)

    created tax status details

Raises:



573
574
575
576
577
578
579
580
581
582
583
# File 'lib/belvo/resources.rb', line 573

def retrieve(link:, options: nil)
  options = TaxStatusOptions.from(options)
  body = {
    link: link,
    token: options.token,
    save_data: options.save_data || true,
    attach_pdf: options.attach_pdf
  }.merge(options)
  body = clean body: body
  @session.post(@endpoint, body)
end