Skip to content

tsongloong/cakephp-vat-number-check-webservice

 
 

Repository files navigation

VatNumberCheck (Web Service) plugin for CakePHP

Build Status PHP 7 ready Coverage Status Packagist downloads Code Climate Scrutinizer Code Quality

Requirements

  • CakePHP 2.9.0 or greater.
  • PHP 7.0.0 or greater.

Installation

Clone/Copy the files in this directory into app/Plugin/VatNumberCheck

Configuration

Ensure the plugin is loaded in app/Config/bootstrap.php by calling:

CakePlugin::load('VatNumberCheck', ['routes' => true]);

Ensure to configure the following lines in app/Config/database.php:

public $vatNumberCheckWebservice = [
	'datasource' => 'VatNumberCheck.SoapSource',
	'wsdl' => 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'
];

Usage

Model

Normalizes a VAT number:

$vatNumber = $this->VatNumberCheck->normalize($vatNumber);

Checks a given VAT number:

$vatNumberValid = $this->VatNumberCheck->check($vatNumber);

Helper

Generates a VAT number check form field:

echo $this->VatNumberCheck->input('vat_number', ['label' => __('VAT number')]);

About

A VAT number check (Web Service) Plugin for CakePHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 89.3%
  • JavaScript 10.7%