-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order of WooCommerce checkout actions causing incompatibility with AvaTax address validation (375) #335
Comments
Hello @nikolas4175-godaddy, I took a look but I can not reproduce following the current steps, also I've checked the order of execution and seems When you have time please let us know how can we reproduce it, maybe we are missing something here but seems working on latest release (1.6.1) |
Hi @Dinamiko 👋 Thanks for taking a look! It looks like I missed a key setting earlier, sorry about that! Could you please test with Require for Tax Calculation enabled in the AvaTax Address Validation settings as well? I believe that will produce the error. I've also reviewed my logging of the order of execution and can clarify on that a bit. What I'm seeing is |
Hey there! Checking back in to let you know that this issue appears to be causing a conflict with another of our plugins, Local Pickup Plus, as well. Our plugin allows customers to select a location where they will pickup their order during checkout, and this location data is stored first as session data before being written to the WooCommerce order itself. That session data is verified and saved during Since PayPal Payments seems to be calling So, as with the AvaTax conflict, it seems that the additional call to Let me know if you have any questions on that or if I can help with any other details here 🙂 |
Thanks for the detailed info! I´m able to reproduce it now, as you said it does call We´re now investigating it, once I have more info I´ll let you know, thanks. |
Seems we have found a solution for fixing the validation problem, here is the PR with the related info: #341 When you have time would be great if you can give it a try to ensure the fix works on your side, I´m attaching the package with the fix here just in case: |
Create a new issue after upcoming release to improve the validation when creating the PayPal order from checkout page, while we're expecting to see a reduction of support issues related to WC failed orders (we are now creating the WC order only after PayPal order is approved and WC checkout form is validated correctly) there is still room for improvement related to validation when creating the PayPal order. |
Hi @Dinamiko, I'm stepping in as @nikolas4175-godaddy is taking some time off right now. I tested the pre-release you shared here and was able to process an order successfully! 🚀 |
Hi @tzuk-godaddy, That sounds great, thanks for checking it! We are currently preparing the upcoming release so it should not take too long. Regarding sharing the pre-release package, feel free to do it, the more we test it the better :) |
Description
PayPal Payments is causing the
woocommerce_checkout_order_processed
action to run beforewoocommerce_after_checkout_validation
when processing payment, which is reverse of how those actions are usually ran in WC.AvaTax stores its
wc_avatax_address_validated
flag in session data, and this is later checked duringwoocommerce_after_checkout_validation
. However, session data is reset duringwoocommerce_checkout_order_processed
, so by calling that action first, PayPal Payments is causing the validation flag to be cleared before it can be verified.This prevents payment from being processed and causes the “Please validate your address to continue” message to appear at checkout, even if the address had already been validated.
The issue occurs consistently on a default theme with only WooCommerce, PayPal Payments, and AvaTax plugins enabled.
A default checkout option like COD runs the actions in the correct order.
I also tested with a SkyVerge gateway plugin that has a similar off-site redirect to that of PayPal Payments, and the actions ran in the expected order there, allowing payment to process with a validated address.
To reproduce
Expected behavior
For customers: When my address is validated at checkout, address validation should not prevent me from completing payment.
For AvaTax & other plugins: PayPal Payments should call WooCommerce checkout actions in the expected order, specifically
woocommerce_checkout_order_processed
should only run afterwoocommerce_after_checkout_validation
Environment:
Tested on:
Additional details
A8C Ref: 4322337-zen
SV Ref: 179556
The text was updated successfully, but these errors were encountered: