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 30 forks source link

Compatibility with PHP 8.2 #366

Open fahu opened 1 year ago

fahu commented 1 year ago

Description

When creating a credit memo the following error is thrown: Creation of dynamic property Taxjar\SalesTax\Model\Transaction\Order::$apiKey is deprecated.

image

Steps to Reproduce

  1. Create a new order
  2. Wait until the order gets in status "processing"
  3. Create a credit memo

Versions

TaxJar module 2.1.0 Magento 2.4.6 PHP 8.2

TechDriven commented 11 months ago

Hi @sethobey, @fastdivision

Can we have any update on this? We have updated the PHP version to 8.2 and now we getting the same issue including other one like:

1 exception(s):
Exception #0 (Exception): Deprecated Functionality: Creation of dynamic property Taxjar\SalesTax\Model\Import\Rate::$_calculationFactory is deprecated in /vendor/taxjar/module-taxjar/Model/Import/Rate.php on line 100 

Thank you,

JeremyAtMethodMarketing commented 10 months ago

I am also getting this deprecation notice on magento 2.4.6-p1 with taxjar/module 2.2.0 with php 8.1-fpm.

It is being displayed to customers which is causing an issue for our client. They are reporting an increase in customer service calls because customers are unsure if their orders are being processed. Is there anyone working on this?

Jakub-Czech commented 8 months ago

I have the same issue. Module's composer.json of the newest version does not have requirements for PHP version and there is a lot of deprecated functionalities in the module which results in error messages if we use PHP 8.1+

ootri commented 7 months ago

These can be fixed very easily, although it's odd nobody at TaxJar made these fixes for such a long time.

In file: ./vendor/taxjar/module-taxjar/Model/Transaction/Order.php Towards the top of the file, but inside the class, add this line: protected $apiKey;

In file: ./vendor/taxjar/module-taxjar/Model/Transaction/Refund.php Same general area, add: protected $apiKey;

In file: ./vendor/taxjar/module-taxjar/Model/Import/Rate.php Add: protected $_calculationFactory;

JeremyAtMethodMarketing commented 7 months ago

Thank you, also i would recommend that you instead add

protected $apiKey;

to /vendor/taxjar/module-taxjar/Model/Transaction.php

because bother order and refund inherit that class so you only need to add it in one place.

SAN1TAR1UM commented 6 months ago

It it highly frowned upon to modify the core files directly, there are many good reasons for this. You should implement these changes in a(some) composer patch(es) to be applied at deployment. See example here: https://github.com/taxjar/taxjar-magento2-extension/issues/370#issuecomment-2005567145