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

Fix error on disconnect with sandbox mode enabled #338

Closed sethobey closed 1 year ago

sethobey commented 1 year ago

Context

Closes #337

Contributor reported bug when disconnecting TJ extension if sandbox mode was enabled.

Description

This fix refactors our existing Disconnect::class.

  1. Deletes sandbox enabled flag and sandbox api key values on disconnect to handle config error state that resulted in UI bug.
  2. Adds new public method that provides a list of core config values that should be purged from all scopes upon disconnecting that can be reused across scopes and is made public for merchant extensibility.
  3. Refactors nexus address and product tax category purge to use best-practice of collection factory injection instead of directly injecting collection resource model.

Performance

N/A - bug fix

Testing

  1. Enable/connect to TaxJar
  2. Enabled Sandbox mode with sandbox API key and save settings.
  3. Disconnect from TaxJar
  4. Observe disconnected successfully
  5. Reconnect to TaxJar successfully

https://user-images.githubusercontent.com/47947793/188727073-f1047e47-fb3b-4af1-9337-eb8cecd1f6a0.mov

Versions