taxjar / taxjar-magento2-extension

Magento 2 Sales Tax Extension by TaxJar
http://www.taxjar.com/guides/integrations/magento2/
Open Software License 3.0
22 stars 29 forks source link

XCON 168: Controller composition #334

Closed sethobey closed 2 years ago

sethobey commented 2 years ago

Context

This PR was originally supposed to refactor controller methods to use Magento HttpMethodInterface(s) instead of inheriting from Action or AbstractAction controller classes. It became apparent that this would be impractical because although controller inheritance has been deprecated, there is no direct replacement for implementing a custom "admin" controller with ACL permissions.

After looking into the only remaining "refactorable" controller, it became apparent that it was not actually in use.

Description

Removes dead code TaxJar's address validation uses a WebAPI rest endpoint defined in etc/webapi.xml, not the controller which was defined at Controller/AddressValidation/Index.php. There is no etc/routes.xml or etc/frontend/routes.xml where the controller frontname could be defined, and given the canonical URL format is <base_url>/<frontname>/<controller_pathname>/<filename>, we would expect the URL for such a controller should be something like baseurl.com/Taxjar/AddressValidation/Index.php or baseurl.com/taxjar/address_validation/index.php neither of which is a valid enpoint.

Updates Fixes some code standards issues and updates copyright date.

Performance

No impact.

Testing

  1. Tested address validation via guest checkout
  2. Tested address validation via admin order entry.

Versions