VatifyEu
extends Base
in package
Vatify API class.
Table of Contents
- $allowedModules : array<string|int, string>
- $description : string
- $displayType : string
- $docUrl : string
- $formFieldsToRecordMap : mixed
- {@inheritdoc}
- $icon : string
- $label : string
- $moduleName : string
- $settingsFields : array<string|int, mixed>
- $addOnName : string
- $data : array<string|int, mixed>
- $fields : mixed
- var array List of fields for the modal search window.
- $modulesFieldsMap : array<string|int, mixed>
- $name : string
- $paid : bool
- $request : Request
- $response : array<string|int, mixed>
- $accessKey : string
- $bearerToken : string
- $clientId : string
- $url : mixed
- {@inheritdoc}
- __construct() : mixed
- Constructor.
- getFields() : array<string|int, Vtiger_Field_Model>
- Get fields for the modal search window.
- getFieldsLabelsByModule() : array<string|int, string>
- Get fields labels for the module name.
- getFieldsModule() : array<string|int, string>
- Get fields for the module name.
- getName() : string
- Get record collector name.
- isActive() : bool
- Check whether it is active.
- isAvailable() : bool
- Check if product is available.
- loadData() : void
- Load data.
- search() : array<string|int, mixed>
- Search data function.
- setRequest() : void
- Set request.
- getParams() : array<string|int, mixed>
- Get params of collector.
- getBearerToken() : void
- Function fetching Bearer Token.
- getDataFromApi() : void
- Function fetching company data by VAT ID and Country.
- loadCredentials() : void
- Function setup Api Key.
- parseData() : void
- Function parsing data to fields from API.
Properties
$allowedModules
public
array<string|int, string>
$allowedModules
= ['Accounts', 'Leads', 'Vendors', 'Partners', 'Competition']
Allowed modules.
$description
public
string
$description
= 'LBL_VATIFY_DESC_EU'
Additional description, visible in the modal window.
$displayType
public
string
$displayType
= 'FillFields'
Search results display type.
$docUrl
public
string
$docUrl
= 'https://www.vatify.eu/docs/api/getting-started/'
Url to Documentation API
$formFieldsToRecordMap
{@inheritdoc}
public
mixed
$formFieldsToRecordMap
= ['Accounts' => ['title' => 'accountname', 'transliteratedTitle' => 'accountname', 'registration_number' => 'registration_number_1', 'identifier' => 'vat_id', 'tax_id_number' => 'vat_id', 'sector' => 'siccode', 'transliteratedSector' => 'siccode', 'address' => 'addresslevel8a', 'transliteratedAddress' => 'addresslevel8a', 'postal_code' => 'addresslevel7a', 'city' => 'addresslevel5a', 'transliteratedCity' => 'addresslevel5a', 'community' => 'addresslevel4a', 'region' => 'addresslevel2a', 'transliteratedRegion' => 'addresslevel2a', 'country' => 'addresslevel1a', 'phone_number' => 'phone', 'fax_number' => 'fax', 'email_address' => 'email1'], 'Leads' => ['title' => 'company', 'transliteratedTitle' => 'company', 'registration_number' => 'registration_number_1', 'identifier' => 'vat_id', 'tax_id_number' => 'vat_id', 'address' => 'addresslevel8a', 'transliteratedAddress' => 'addresslevel8a', 'postal_code' => 'addresslevel7a', 'city' => 'addresslevel5a', 'transliteratedCity' => 'addresslevel5a', 'community' => 'addresslevel4a', 'region' => 'addresslevel2a', 'transliteratedRegion' => 'addresslevel2a', 'country' => 'addresslevel1a', 'phone_number' => 'phone', 'fax_number' => 'fax', 'email_address' => 'email'], 'Vendors' => ['title' => 'vendorname', 'transliteratedTitle' => 'vendorname', 'registration_number' => 'registration_number_1', 'identifier' => 'vat_id', 'tax_id_number' => 'vat_id', 'transliteratedSector' => 'siccode', 'address' => 'addresslevel8a', 'transliteratedAddress' => 'addresslevel8a', 'postal_code' => 'addresslevel7a', 'city' => 'addresslevel5a', 'transliteratedCity' => 'addresslevel5a', 'community' => 'addresslevel4a', 'region' => 'addresslevel2a', 'transliteratedRegion' => 'addresslevel2a', 'country' => 'addresslevel1a', 'phone_number' => 'phone', 'email_address' => 'email'], 'Partners' => ['title' => 'subject', 'transliteratedTitle' => 'subject', 'identifier' => 'vat_id', 'tax_id_number' => 'vat_id', 'transliteratedSector' => 'siccode', 'address' => 'addresslevel8a', 'transliteratedAddress' => 'addresslevel8a', 'postal_code' => 'addresslevel7a', 'city' => 'addresslevel5a', 'transliteratedCity' => 'addresslevel5a', 'community' => 'addresslevel4a', 'region' => 'addresslevel2a', 'transliteratedRegion' => 'addresslevel2a', 'country' => 'addresslevel1a', 'email_address' => 'email'], 'Competition' => ['title' => 'subject', 'transliteratedTitle' => 'subject', 'identifier' => 'vat_id', 'tax_id_number' => 'vat_id', 'address' => 'addresslevel8a', 'transliteratedAddress' => 'addresslevel8a', 'postal_code' => 'addresslevel7a', 'city' => 'addresslevel5a', 'transliteratedCity' => 'addresslevel5a', 'community' => 'addresslevel4a', 'region' => 'addresslevel2a', 'transliteratedRegion' => 'addresslevel2a', 'country' => 'addresslevel1a', 'email_address' => 'email']]
$icon
public
string
$icon
= 'yfi-vatify-eu'
Icon.
$label
public
string
$label
= 'LBL_VATIFY_EU'
Label.
$moduleName
public
string
$moduleName
Module name.
$settingsFields
public
array<string|int, mixed>
$settingsFields
= ['client_id' => ['required' => 1, 'purifyType' => 'Text', 'label' => 'LBL_CLIENT_ID'], 'access_key' => ['required' => 1, 'purifyType' => 'Text', 'label' => 'LBL_ACCESS_KEY']]
Configuration field list.
$addOnName
protected
string
$addOnName
= 'YetiForceRcVatifyEu'
The name of Add-on.
$data
protected
array<string|int, mixed>
$data
= []
Data from record collector source.
$fields
var array List of fields for the modal search window.
protected
mixed
$fields
= ['country' => ['labelModule' => '_Base', 'label' => 'Country', 'picklistModule' => 'Other.Country', 'typeofdata' => 'V~M', 'uitype' => 16, 'picklistValues' => ['AL' => 'Albania', 'AT' => 'Austria', 'BY' => 'Belarus', 'BE' => 'Belgium', 'BA' => 'Bosnia And Herzegovina', 'BG' => 'Bulgaria', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'DE' => 'Germany', 'DK' => 'Denmark', 'EE' => 'Estonia', 'GB' => 'United Kingdom', 'GR' => 'Greece', 'ES' => 'Spain', 'FI' => 'Finland', 'FR' => 'France', 'GB' => 'Northern Ireland', 'GE' => 'Georgia', 'HR' => 'Croatia', 'HU' => 'Hungary', 'IS' => 'Iceland', 'IE' => 'Ireland', 'IL' => 'Israel', 'IT' => 'Italy', 'KZ' => 'Kazakstan', 'Kosovo' => 'Kosovo', 'LV' => 'Latvia', 'LI' => 'Liechtenstein', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'MK' => 'Macedonia, The Former Yugoslav Republic Of', 'MT' => 'Malta', 'MD' => 'Moldova, Republic Of', 'ME' => 'Montenegro', 'NO' => 'Norway', 'NL' => 'Netherlands', 'PL' => 'Poland', 'PT' => 'Portugal', 'RO' => 'Romania', 'RU' => 'Russian Federation', 'SE' => 'Sweden', 'SK' => 'Slovenia', 'RS' => 'Serbia', 'CH' => 'Switzerland', 'UA' => 'Ukraine', 'ZA' => 'South Africa']], 'vatNumber' => ['labelModule' => '_Base', 'label' => 'Vat ID', 'typeofdata' => 'V~M']]
$modulesFieldsMap
protected
array<string|int, mixed>
$modulesFieldsMap
= ['Accounts' => ['vatNumber' => 'vat_id', 'country' => 'addresslevel1a'], 'Leads' => ['vatNumber' => 'vat_id', 'country' => 'addresslevel1a'], 'Vendors' => ['vatNumber' => 'vat_id', 'country' => 'addresslevel1a'], 'Competition' => ['vatNumber' => 'vat_id', 'country' => 'addresslevel1a']]
Fields mapping for loading record data.
$name
protected
string
$name
Record collector name.
$paid
protected
bool
$paid
= true
Requires subscription.
$request
protected
Request
$request
Request instance.
$response
protected
array<string|int, mixed>
$response
= []
Response data.
$accessKey
private
string
$accessKey
Access Key.
$bearerToken
private
string
$bearerToken
Bearer Token.
$clientId
private
string
$clientId
Client ID.
$url
{@inheritdoc}
private
mixed
$url
= 'https://api.vatify.eu/v1/'
Methods
__construct()
Constructor.
public
__construct() : mixed
Return values
mixed —getFields()
Get fields for the modal search window.
public
getFields() : array<string|int, Vtiger_Field_Model>
Return values
array<string|int, Vtiger_Field_Model> —getFieldsLabelsByModule()
Get fields labels for the module name.
public
getFieldsLabelsByModule(string $moduleName) : array<string|int, string>
Parameters
- $moduleName : string
Return values
array<string|int, string> —getFieldsModule()
Get fields for the module name.
public
getFieldsModule(string $moduleName) : array<string|int, string>
Parameters
- $moduleName : string
Return values
array<string|int, string> —getName()
Get record collector name.
public
getName() : string
Return values
string —isActive()
Check whether it is active.
public
isActive() : bool
Return values
bool —isAvailable()
Check if product is available.
public
isAvailable() : bool
Return values
bool —loadData()
Load data.
public
loadData() : void
Return values
void —search()
Search data function.
public
search() : array<string|int, mixed>
Return values
array<string|int, mixed> —setRequest()
Set request.
public
setRequest(Request $request) : void
Parameters
- $request : Request
Return values
void —getParams()
Get params of collector.
protected
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —getBearerToken()
Function fetching Bearer Token.
private
getBearerToken() : void
Return values
void —getDataFromApi()
Function fetching company data by VAT ID and Country.
private
getDataFromApi(array<string|int, mixed> $params) : void
Parameters
- $params : array<string|int, mixed>
Return values
void —loadCredentials()
Function setup Api Key.
private
loadCredentials() : void
Return values
void —parseData()
Function parsing data to fields from API.
private
parseData() : void