Class: Belvo::TaxComplianceStatus

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

Overview

A Tax compliance 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) ⇒ TaxComplianceStatus

Returns a new instance of TaxComplianceStatus.



414
415
416
417
# File 'lib/belvo/resources.rb', line 414

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

Instance Method Details

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



436
437
438
439
# File 'lib/belvo/resources.rb', line 436

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

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

Retrieve tax compliance status information from a specific fiscal link.

Parameters:

Returns:

  • (Hash)

    created tax compliance status details

Raises:



424
425
426
427
428
429
430
431
432
433
434
# File 'lib/belvo/resources.rb', line 424

def retrieve(link:, options: nil)
  options = TaxComplianceStatusOptions.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