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

TaxJar Error displayed to customers on success page #370

Open JeremyAtMethodMarketing opened 11 months ago

JeremyAtMethodMarketing commented 11 months ago

Prerequisites

Description

I am on magento 2.4.6-p1 and using TaxJar magento2 extension 2.2.0. We are now on PHP 8.1-fpm. At checkout people are seeing deprecation notices and they believe that their orders are not being processed. They are going through but the notice is very concerning. I am also seeing that orders are not syncing to taxjar. We have not had an order sync since Dec 13, 2023.

Deprecated Functionality: Creation of dynamic property TaxJar\SalesTax\Model\Transaction\Order::$apiKey is deprecated in /html/vendor/taxjar/module-taxjar/Model/Transaction/Order.php on line 108

Steps to Reproduce

  1. Upgrade php and magento 2 version to 2.4.6
  2. Install taxjar 2.2.0
  3. place an order

Expected Result

No error message on screen shown to customers and order being synced to taxjar.

Actual Result

Orders not being synced and customers seeing deprecation notices on checkout success page.

Versions

fweb commented 9 months ago

@JeremyAtMethodMarketing Did you guys ever figure out a solution? I don't want to upgrade to taxjar 2.2.0 if this is unresolved. Thx

JeremyAtMethodMarketing commented 9 months ago

@fweb no I haven't been able to find a solution and I haven't heard any from tech support.

SAN1TAR1UM commented 8 months ago

This error means they failed to declare the $apiKey before trying to access it on line 108. You should implement the following composer patch, you don't want to modify the core file directly.

diff --git a/vendor/taxjar/module-taxjar/Model/Transaction/Order.php b/vendor/taxjar/module-taxjar/Model/Transaction/Order.php
index 875d0c0..7dafc91 100644
--- a/vendor/taxjar/module-taxjar/Model/Transaction/Order.php
+++ b/vendor/taxjar/module-taxjar/Model/Transaction/Order.php
@@ -31,6 +31,8 @@ class Order extends \Taxjar\SalesTax\Model\Transaction

     protected const SYNCABLE_COUNTRIES = ['US'];

+    protected $apiKey;
+
     /**
      * @var OrderInterface|AbstractModel
      */
SAN1TAR1UM commented 8 months ago

Actually I like this solution much better: https://github.com/taxjar/taxjar-magento2-extension/issues/366#issuecomment-1955532451

SAN1TAR1UM commented 8 months ago

taxjar_fix_apikey.patch