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.



350
351
352
353
# File 'lib/belvo/resources.rb', line 350

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

Instance Method Details

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



373
374
375
# File 'lib/belvo/resources.rb', line 373

def resume(_session_id, _token, _link: nil)
  raise NotImplementedError 'TaxReturn 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:



360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/belvo/resources.rb', line 360

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