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

Only display "refund manually" button after refund failure. #426

Closed
LevinMedia opened this issue Feb 12, 2020 · 12 comments · Fixed by #2167
Closed

Only display "refund manually" button after refund failure. #426

LevinMedia opened this issue Feb 12, 2020 · 12 comments · Fixed by #2167
Assignees
Labels
component: order details Issues related to Order Details needs docs The issue/PR requires documentation to be added. size: medium The issue is sized medium. status: has pr The issue has a PR.

Comments

@LevinMedia
Copy link
Contributor

LevinMedia commented Feb 12, 2020

Per Stripe: the only time a payment made with WooCommerce payments can be refunded manually should be after a refund via the gateway has failed.

cc: @allendav @thenbrent @bmccotter

@LevinMedia LevinMedia added the component: order details Issues related to Order Details label Feb 12, 2020
@allendav
Copy link
Contributor

allendav commented Mar 2, 2020

This seems like a must-have for V1, right?

@LevinMedia
Copy link
Contributor Author

@allendav yep!

@dechov
Copy link
Contributor

dechov commented Mar 2, 2020

We'll probably want to (conditionally?) enqueue some JS here to hide .do-manual-refund.

@dechov
Copy link
Contributor

dechov commented May 4, 2020

We'll want to track that there's been a refund failure in order meta, I think, as currently process_webhook_refund_updated only adds an a order note.

@jrodger
Copy link
Contributor

jrodger commented May 4, 2020

currently process_webhook_refund_updated only adds an a order note.

That's correct. We also have an issue for expanding that behaviour to cover things like changing the order status (#601).

Tracking the refund failure in order meta would make sense, the only downside I can see would be the chance of the refund failing and then the webhook failing. That would leave the merchant with a refund failure transaction in their dashboard, but no way to resolve it.

As an alternative solution, would it be worth considering tracking the fact that the merchant simply attempted to refund through WCPay instead? The first time they try to refund, they would only see the "Refund with WCPay" button. The UI will update to show that the refund attempt was submitted successfully. Presumably the merchant wouldn't attempt to refund again, so we could show the manual refund button at that point. That would be more robust, but at the risk of making the UI more confusing.

Also, do we need to consider partial refunds as part of this? It's not something I've played around with much.

@marcinbot marcinbot added this to the Sprint 20 milestone Oct 16, 2020
@marcinbot marcinbot removed this from the Sprint 20 milestone Nov 6, 2020
@thenbrent
Copy link

This issue is causing support tickets as mentioned in p6q7sZ-7TF-p2

@SiR-DanieL
Copy link
Member

one customer has an issue with this in 3837596-zen

@DustinHartzler
Copy link

It happened in this ticket too: 3831519-zen

@dechov
Copy link
Contributor

dechov commented Jun 3, 2021

Likely cause of the issue in pbUcTB-f4-p2

@reykjalin reykjalin removed their assignment Jun 4, 2021
@reykjalin reykjalin self-assigned this Jun 14, 2021
@reykjalin
Copy link
Contributor

Tracking the refund failure in order meta would make sense, the only downside I can see would be the chance of the refund failing and then the webhook failing. [...] would it be worth considering tracking the fact that the merchant simply attempted to refund through WCPay instead?

I don't think counting attempts is enough. What if they do a partial refund? Once the partial refund has been completed, they'd now see the Manual Refund button.

I guess we could reset the attempt counter once the webhook is successfully handled? But even then I think it'd be more robust to check for failures. Webhook delivery issues will always cause problems, no matter what we do about it.

That said, we could always count both the attempts and failures and somehow tally the numbers to make a more intelligent decision about which buttons to show.

The first time they try to refund, they would only see the "Refund with WCPay" button. The UI will update to show that the refund attempt was submitted successfully. Presumably the merchant wouldn't attempt to refund again, so we could show the manual refund button at that point. That would be more robust, but at the risk of making the UI more confusing.

I wonder what @LevinMedia's thoughts are on this UX. Is it better to:

  • Possibly never getting the manual refund option in case of failures; or
  • Seeing the manual refund option prematurely — or when the order has already been completely refunded?

Also, do we need to consider partial refunds as part of this? It's not something I've played around with much.

I think so. Just thinking about it I could see partial refunds messing with some of the proposed solutions.

I think the simplest one (least amount of edge cases) is the "only show manual refund after failure" approach. Other approaches might be more robust, but will require more detailed handling.

@LevinMedia
Copy link
Contributor Author

I think the simplest one (least amount of edge cases) is the "only show manual refund after failure" approach. Other approaches might be more robust, but will require more detailed handling.

@reykjalin I agree - given that the likelyhood of a refund failing at the same time a webhook is low - I think we can move forward with this approach.

@tijosh
Copy link

tijosh commented Jun 16, 2021

Occurrence in 29406563-hc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: order details Issues related to Order Details needs docs The issue/PR requires documentation to be added. size: medium The issue is sized medium. status: has pr The issue has a PR.
Projects
None yet