Skip to content
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

Investigate: Unlinked renewal orders after paying for failed order #702

Open
2 tasks
james-allan opened this issue Oct 21, 2024 · 0 comments
Open
2 tasks
Labels
type: task The issue is an internally driven task (e.g. from another A8c team).

Comments

@james-allan
Copy link
Contributor

Describe the bug

In the past we've worked on a number of changes that are designed to prevent a bug where a customer pays for a failed renewal order and the resulting order is a new-unlinked order. The expected behaviour is that it the existing renewal order should be reused, no new order should be created.

There are still reports of stores being impacted by this.

We need to find a way to resolve that. We don't currently know what the cause is, and we haven't been able to replicate it. I see this issue needing to be broken down into two parts:

  1. Observe
  2. Formulate a fix

OBSERVE 👀

When you pay for a failed renewal order, we attempt to force WooCommerce to reuse the existing order.
We do this by making sure the order's cart hash is updated. see update_cart_hash() and set_renewal_order_cart_hash_on_block_checkout().

This must not be working in some (perhaps rare) circumstances.

We need to observe/log if these functions are working as expected. We can probably do that by hooking onto woocommerce_checkout_create_order() and checking if the cart contains a renewal order and if the order's cart hash matches the cart.

Tip

Maybe it's someone hooking onto woocommerce_create_order and creating an order themselves - bypassing WooCommerce checking if the order can be resumed. 🤷‍♂

FIX 🛠

Based on what we observe from the logging adding above, find a fix.

Product impact

  • Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref

Additional context

@james-allan james-allan added the type: task The issue is an internally driven task (e.g. from another A8c team). label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task The issue is an internally driven task (e.g. from another A8c team).
Projects
None yet
Development

No branches or pull requests

1 participant