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

Issue with sync transactions all zips fail #315

Closed danmentzer closed 2 years ago

danmentzer commented 2 years ago

Prerequisites

Description

Currently when trying to run the transactions sync the sync says it is successful but no data can be found in taxjar. After reviewing the transactions log the orders all hit errors of unsyncable or bad request saying the to zip does not match the state but the states do in fact have those zips.

Steps to Reproduce

  1. Sync transactions
  2. Set dates for from and to
  3. Sync

Expected Result

Data sent to taxjar after seeing a success message

Actual Result

Success message with nothing in taxjar

Versions

sethobey commented 2 years ago

Hi @danmentzer, I know this must be quite frustrating, but unfortunately I was not able to reproduce this issue using Magento 2.4.3-p1 with PHP 7.4 or 2.4.4 with PHP 8.1.

You mention that you are setting "from" and "to" dates then syncing, so I inferred that you are using the Transaction Backfill feature via adminhtml UI. Since our transaction backfill relies on the message queue, whether triggered via UI or CLI, a success message should be expected so long as our extension is able to properly serialize an array of order ids.

You also mentioned

the orders all hit errors of unsyncable or bad request.

Logging unsyncable orders is to be expected as you can see here and a user-friendly explanation of why the order was not syncable is available in the sales order view under the "TaxJar Information" sidebar tab.

In the case of bad request error, any HTTP request failure should throw exception terminating the sync process, so if there is even one order with invalid data within the selected range it will continuously cause the entire sync to fail.

Lastly, with high web traffic, there is sometimes a delay between when a transaction is synced from M2 to TaxJar and when that transaction is actually visible in the TaxJar UI. This has also caused me concern in the past before realizing the cause, but if you do not wish to wait for updates to be propagated to the UI, you can query our orders endpoint (https://api.taxjar.com/v2/transactions/orders?from_transaction_date=<START_DATE>&to_transaction_date=<END_DATE>) via cURL or Postman for the most up-to-date list of transaction ids.

Based on the issue description, this likely doesn't solve the zip-region mismatch error you are experiencing, but hopefully these details might provide more context in which to identify the solution!

I'm going to close this issue since it is currently unreproducible, but for any further assistance, please do reach out to our technical support staff. They will be able to review your account activity, including API activity, and you will be able to share sensitive information with them such as M2 TaxJar logs which may help resolve the issue.