Validatevat.php 883 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Controller\Adminhtml\System\Config;
  7. /**
  8. * VAT validation controller
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. */
  12. abstract class Validatevat extends \Magento\Backend\App\Action
  13. {
  14. /**
  15. * Authorization level of a basic admin session
  16. *
  17. * @see _isAllowed()
  18. */
  19. const ADMIN_RESOURCE = 'Magento_Customer::manage';
  20. /**
  21. * Perform customer VAT ID validation
  22. *
  23. * @return \Magento\Framework\DataObject
  24. */
  25. protected function _validate()
  26. {
  27. return $this->_objectManager->get(\Magento\Customer\Model\Vat::class)
  28. ->checkVatNumber(
  29. $this->getRequest()->getParam('country'),
  30. $this->getRequest()->getParam('vat')
  31. );
  32. }
  33. }