VATIN Bundle: Symfony Bundle for The VATIN Library

VATIN bundle 

A Symfony bundle for the VATIN library.

Installation

This library is available on Packagist:

composer require ddeboer/vatin-bundle

Then add the bundle to your application:

// app/AppKernel.php
public function registerBundles()
{
    return [
        ...
        new Ddeboer\VatinBundle\DdeboerVatinBundle(),
        ...
    ];
}

Usage

Validate number format

Use the validator to validate a property on your models. For instance using annotations:

use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

class Company
{
    /**
     * @Vatin
     */
    protected $vatNumber;

Symfony’s validator will now check whether $vatNumber has a valid VAT number format. For more information, see Symfony’s documentation.

Validate number existence

Additionally, you can check whether the VAT number is in use:

    use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

    /**
     * @Vatin(checkExistence=true)
     */
    protected $vatNumber;

The validator will now check the VAT number against the VAT Information Exchange System (VIES) SOAP web service. This service’s availability is rather unreliable, so it’s a good idea to catch the case where it’s unreachable:

use Symfony\Component\Validator\Exception\ValidatorException;

try {
    if ($validator->isValid()) {
        // Happy flow
    }
} catch (ValidatorException $e) {
    // VAT could not be validated because VIES service is unreachable
}

Using the services directly

You can also use this bundle’s services directly. Validate a VAT number’s format:

$validator = $container->get('ddeboer_vatin.vatin_validator');
$bool = $validator->isValid('NL123456789B01');

Additionally, check whether the VAT number is in use:

$bool = $validator->isValid('NL123456789B01', true);

To interact with the VIES webservice:

$vies = $container->get('ddeboer_vatin.vies.client');
$checkVatResponse = $vies->checkVat('NL', '123456789B01');

More information

For more information, see the VATIN library’s documentation.


Download Details:

Author: ddeboer
Source Code: https://github.com/ddeboer/vatin-bundle

License: MIT license

#symfony #php 

What is GEEK

Buddha Community

VATIN Bundle: Symfony Bundle for The VATIN Library

Vatin-bundle: Symfony Bundle for The VATIN Library

VATIN bundle

A Symfony bundle for the VATIN library.

Installation

This library is available on Packagist:

composer require ddeboer/vatin-bundle

Then add the bundle to your application:

// app/AppKernel.php
public function registerBundles()
{
    return [
        ...
        new Ddeboer\VatinBundle\DdeboerVatinBundle(),
        ...
    ];
}

Usage

Validate number format

Use the validator to validate a property on your models. For instance using annotations:

use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

class Company
{
    /**
     * @Vatin
     */
    protected $vatNumber;

Symfony’s validator will now check whether $vatNumber has a valid VAT number format. For more information, see Symfony’s documentation.

Validate number existence

Additionally, you can check whether the VAT number is in use:

    use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

    /**
     * @Vatin(checkExistence=true)
     */
    protected $vatNumber;

The validator will now check the VAT number against the VAT Information Exchange System (VIES) SOAP web service. This service’s availability is rather unreliable, so it’s a good idea to catch the case where it’s unreachable:

use Symfony\Component\Validator\Exception\ValidatorException;

try {
    if ($validator->isValid()) {
        // Happy flow
    }
} catch (ValidatorException $e) {
    // VAT could not be validated because VIES service is unreachable
}

Using the services directly

You can also use this bundle’s services directly. Validate a VAT number’s format:

$validator = $container->get('ddeboer_vatin.vatin_validator');
$bool = $validator->isValid('NL123456789B01');

Additionally, check whether the VAT number is in use:

$bool = $validator->isValid('NL123456789B01', true);

To interact with the VIES webservice:

$vies = $container->get('ddeboer_vatin.vies.client');
$checkVatResponse = $vies->checkVat('NL', '123456789B01');

More information

For more information, see the VATIN library’s documentation.

Author: ddeboer
Source Code: https://github.com/ddeboer/vatin-bundle 
License: MIT License

#php #symfony 

VATIN Bundle: Symfony Bundle for The VATIN Library

VATIN bundle 

A Symfony bundle for the VATIN library.

Installation

This library is available on Packagist:

composer require ddeboer/vatin-bundle

Then add the bundle to your application:

// app/AppKernel.php
public function registerBundles()
{
    return [
        ...
        new Ddeboer\VatinBundle\DdeboerVatinBundle(),
        ...
    ];
}

Usage

Validate number format

Use the validator to validate a property on your models. For instance using annotations:

use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

class Company
{
    /**
     * @Vatin
     */
    protected $vatNumber;

Symfony’s validator will now check whether $vatNumber has a valid VAT number format. For more information, see Symfony’s documentation.

Validate number existence

Additionally, you can check whether the VAT number is in use:

    use Ddeboer\VatinBundle\Validator\Constraints\Vatin;

    /**
     * @Vatin(checkExistence=true)
     */
    protected $vatNumber;

The validator will now check the VAT number against the VAT Information Exchange System (VIES) SOAP web service. This service’s availability is rather unreliable, so it’s a good idea to catch the case where it’s unreachable:

use Symfony\Component\Validator\Exception\ValidatorException;

try {
    if ($validator->isValid()) {
        // Happy flow
    }
} catch (ValidatorException $e) {
    // VAT could not be validated because VIES service is unreachable
}

Using the services directly

You can also use this bundle’s services directly. Validate a VAT number’s format:

$validator = $container->get('ddeboer_vatin.vatin_validator');
$bool = $validator->isValid('NL123456789B01');

Additionally, check whether the VAT number is in use:

$bool = $validator->isValid('NL123456789B01', true);

To interact with the VIES webservice:

$vies = $container->get('ddeboer_vatin.vies.client');
$checkVatResponse = $vies->checkVat('NL', '123456789B01');

More information

For more information, see the VATIN library’s documentation.


Download Details:

Author: ddeboer
Source Code: https://github.com/ddeboer/vatin-bundle

License: MIT license

#symfony #php 

Symfony Website Development

Symfony is known for its ability to optimize the performance of websites as it consumes less memory, and it allows users to create robust and high-performance web apps. Symfony accelerates time-to-market by saving the significant time of development, and its inbuilt features speed up the web apps development.

Looking for expert Symfony Developers? Contact Skenix Infotech to know our pricing & Symfony Web Services: https://www.skenix.com/symfony-development-company/

#symfony development company #symfony development services #website development #symfony web development #hire symfony developers #symfony development

Aarna Davis

Aarna Davis

1620982596

11 Good Reasons -Why Should You Choose Symfony Development Services?

Symfony is number 1 choice for enterprise web applications. Here are some solid reasons that will make you ready to choose Symfony for your web and app development services requirement.

Read full blog here: https://www.xplace.com/article/8762

#symfonydevelopmentservices
#symfonydevelopmentindia
#symfonydevelopmentcompanyindia
#hiresymphonydevelopers
#bestsymfonydevelopers

#symfony development services #symfony development india #symfony development company india #hire symphony developers #best symfony developers

Embedly Bundle: Symfony 2 Bundle for The Embed.ly Library

Embedly Bundle

Bundle for Symfony 2 providing the embed.ly library.

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require emanueleminotto/embedly-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new EmanueleMinotto\EmbedlyBundle\EmbedlyBundle(),
        );
    }
}

Usage

No more requirements, you can start using the embedly service and the Twig extensions.

License

This bundle is under the MIT license. See the complete license in the bundle:

Resources/meta/LICENSE

API: emanueleminotto.github.io/EmbedlyBundle


Download Details:

Author: EmanueleMinotto
Source Code: https://github.com/EmanueleMinotto/EmbedlyBundle

#symfony #php