Blesta Source Documentation

TaxInterface

Tax interface

Table of Contents

Methods

getCountries() Gets a list of the countries where these tax requirements apply
getFields() Gets a list of input fields for this tax provider
getName() Gets the name of the tax provider
getTaxInformation() Gets the tax information of a given tax ID
isEnabled() Checks if the tax provider is enabled or not
isExemptionHandlerEnabled() Checks if the tax provider will automatically handle TAX exemptions or not
validateTaxId() Verifies if a given tax ID is valid
Methods

getCountries()

Gets a list of the countries where these tax requirements apply

public getCountries() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list containing the country codes in ISO 3166-1 alpha2

getFields()

Gets a list of input fields for this tax provider

public getFields([array<string|int, mixed> $vars = [] ]) : InputFields
Parameters
$vars : array<string|int, mixed> = []

A list of submitted inputs that act as defaults for filter fields

Return values
InputFields

An object representing the list of filter input field

getName()

Gets the name of the tax provider

public getName() : string
Return values
string

The name of the tax provider

getTaxInformation()

Gets the tax information of a given tax ID

public getTaxInformation(string $tax_id[, array<string|int, mixed> $client = null ]) : array<string|int, mixed>
Parameters
$tax_id : string

The tax ID from which to obtain the information

$client : array<string|int, mixed> = null

An array containing the client data associated with the tax ID

Return values
array<string|int, mixed>

An array containing the tax data

  • name The name of the taxpayer
  • address The address of the taxpayer
  • country The country of the taxpayer
  • state The state/province of the taxpayer
  • type Whether the taxpayer is an individual or a business
  • tax_id The formatted tax ID
  • tax_exempt True if the taxpayer is exempt from taxes, false otherwise
  • settings A list of additional parameters (optional)

isEnabled()

Checks if the tax provider is enabled or not

public isEnabled([int $company_id = null ]) : bool
Parameters
$company_id : int = null

The ID of the company to check (optional)

Return values
bool

True if the tax provider is enabled

isExemptionHandlerEnabled()

Checks if the tax provider will automatically handle TAX exemptions or not

public isExemptionHandlerEnabled([int $company_id = null ]) : bool
Parameters
$company_id : int = null

The ID of the company to check (optional)

Return values
bool

True if the tax provider will handle TAX exemptions

validateTaxId()

Verifies if a given tax ID is valid

public validateTaxId(string $tax_id[, array<string|int, mixed> $client = null ]) : bool
Parameters
$tax_id : string

The tax ID to verify

$client : array<string|int, mixed> = null

An array containing the client data associated with the tax ID

Return values
bool

True if the given tax ID is valid, false otherwise

Tags
subpackage

core.Util.Tax.Common

copyright

Copyright (c) 2021, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results