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 regression in TaxJar customer sync #351

Closed sethobey-stripe closed 1 year ago

sethobey-stripe commented 1 year ago

Context

At some point the Magento customer module updated the event name customer_save_before to adminhtml_customer_prepare_save where the former was used to trigger customer updates in TaxJar and the event customer_delete_before which was used to trigger customer deletion in TaxJar no longer exists.

Additionally, custom attributes added to the the customer model should now be fetched using the getCustomAttribute() method rather than calling the previous magic methods.

i.e. $customer->getTjCustomValue() is now $customer->getCustomAttribute('tj_custom_value')

Description

Performance

N/A

Testing

  1. Created a non-exempt customer in M2.
  2. Verified M2 customer synced to TaxJar
  3. Modified customer to have exemption type of "wholesale"
  4. Verified customer resource updated in TaxJar to reflect the new exemption type
  5. Deleted customer in M2
  6. Verified customer resource deleted in TaxJar

Versions

perryholden commented 7 months ago

I'm not sure I understand why this was needed. The customer_save_before event has not gone anywhere, nor is it going away. The adminhtml_customer_prepare_save event has been in the codebase since 2.0.0.0-dev87 (10 years ago).

Since this change, we have been seeing odd behavior surrounding customer sync. Before I open an issue, is it possible to understand why this change was even needed?