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

Identify and delete a refund when an async refund failure occurs #2285

Closed
reykjalin opened this issue Jun 21, 2021 · 0 comments · Fixed by #3965
Closed

Identify and delete a refund when an async refund failure occurs #2285

reykjalin opened this issue Jun 21, 2021 · 0 comments · Fixed by #3965
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. size: medium The issue is sized medium. type: bug The issue is a confirmed bug.

Comments

@reykjalin
Copy link
Contributor

Currently, when refunds fail asynchronously, the WC refund is still present in the Order Details page. We should try to delete the WC refund so it's not present on the order after a refund has failed.

I think can probably (identify and) delete the refund when an async refund failure comes in, as is done in the sync refund failure case in WC core [source] – we can open a separate issue for that though, since it's not strictly related to the change in this PR.

Originally posted by @dechov in #2167 (comment)

I looked into this briefly, and I'm pretty sure we'll need to add some meta data to either the main WC_Order or the WC_Order_Refund so we can identify the refund we should be deleting.

Reproduction steps

  1. Pay for an order with the 4000 0000 0000 5126 testing card
  2. Open that order's details page
  3. Refund any non-zero amount for the order
  4. The refund will fail asynchronously which means:
    • You have to wait 5-10 seconds and then reload the page to see the refund failure.
    • You have to make sure webhooks work
  5. Now that you've reloaded the page notice that the refund failed (there should be an order note) and the WC refund still exists in the list of items associated with the WC Order.
@reykjalin reykjalin added type: enhancement The issue is a request for an enhancement. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. size: medium The issue is sized medium. labels Jun 21, 2021
@vbelolapotkov vbelolapotkov added category: core WC Payments core related issues, where it’s obvious. type: bug The issue is a confirmed bug. and removed type: enhancement The issue is a request for an enhancement. labels Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. size: medium The issue is sized medium. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants