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

Don't attempt to refund an order with an invalid amount #2287

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

Don't attempt to refund an order with an invalid amount #2287

reykjalin opened this issue Jun 21, 2021 · 0 comments · Fixed by #2572
Assignees
Labels
good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. size: small The issue is sized small. type: bug The issue is a confirmed bug.

Comments

@reykjalin
Copy link
Contributor

reykjalin commented Jun 21, 2021

When the order amount is invalid (e.g. when you try to refund an amount that's 0) we still try to process a refund through Stripe. We should catch the issue on the API level and inform the merchant that the refund amount is invalid — without sending the refund request to the Stripe API.

If you just click the refund button (without a valid amount) you get an alert with the error "Invalid refund amount"

Originally reported by @diegocurbelo in #2167 (comment)

Reproduction steps

  1. Pay for an order with 4242 4242 4242 4242
  2. Go to the order details screen
  3. Click Refund
  4. Try to refund an invalid amount via WCPay, e.g. 0, negative amounts, and amounts greater than the order's cost.
@reykjalin reykjalin added type: bug The issue is a confirmed bug. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. size: small The issue is sized small. labels Jun 21, 2021
@dwainm dwainm added the good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. label Jul 9, 2021
@daquinons daquinons self-assigned this Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue The issue is a good candidate for the first community contribution/for a newcomer to the team. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. size: small The issue is sized small. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants