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.



570
571
572
573
# File 'lib/belvo/resources.rb', line 570

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

Instance Method Details

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



592
593
594
595
# File 'lib/belvo/resources.rb', line 592

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:



580
581
582
583
584
585
586
587
588
589
590
# File 'lib/belvo/resources.rb', line 580

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