Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
173 stars 69 forks source link

Refund not possible if order status manually changed to Processing/Completed prior to 'Capture' #5671

Open jrick1229 opened 1 year ago

jrick1229 commented 1 year ago

Describe the bug

If an 'Authorized' order is set manually to 'Processing' or 'Completed' prior to capture, then is captured, the order is never updated to reflect the actual capture. This causes issues with refunds, since the order is now not refundable (as it doesn't believe payment was captured).

To Reproduce

  1. Set WC Pay to authorize
  2. Purchase a product
  3. Set the 'On hold' order to 'Processing' or 'Completed'
  4. Save changes
  5. Navigate to WP Admin > Payments > Transactions > Uncaptured, and capture the order.
  6. Note paid status, then navigate back to the order
  7. Notice there are no notes pertaining to the capture
  8. Click 'Refund' and try to refund the order
  9. See that the notice instructs you to first capture the payment, which was already done

Actual behavior

Payment captured, order is Processing, cannot refund

Expected behavior

Payment is captured, very specific steps shouldn't be needed to simply refund an order

Additional context

6000094-zen

htdat commented 1 year ago

Thanks for the report @jrick1229. I can replicate the bug.

According to Pc2DNy-3z-p2, this falls in @Automattic/pulsar (Auth and Capture). Tagging as a part of Gamma Porter duties PcreKM-yM-p2.

htdat commented 1 year ago

However, this seems relevant to this issue being worked on by @jessy-p https://github.com/Automattic/woocommerce-payments/issues/5603

jessy-p commented 1 year ago

@htdat This issue is not related to the Confirmation modal. It is related to the order not getting captured correctly if the status is changed in between manually. I am not sure if the solution should be to prevent changing the status (we have never really done that, these modals are just giving a warning to the merchant) or allowing the order to be captured correctly, but I prefer the latter. We can check with Product team.

htdat commented 1 year ago

@jessy-p - your last comment makes sense. Let's leave it for Pulsar then they can decide how to approach the issue, or check with Product team.

jessy-p commented 1 year ago

I think this new issue might take care of this: #5712

htdat commented 1 year ago

I think this new issue might take care of this: https://github.com/Automattic/woocommerce-payments/issues/5712

I am closing this issue as it should be handled in https://github.com/Automattic/woocommerce-payments/issues/5712, especially this part:

Changing the status of an authed order to Completed should offer to capture the funds.

csmcneill commented 4 months ago

Reopening since this was reported in 8192646-zen (further discussion in p1715743396825929-slack-C3NCP7ZJ6)

To reproduce:

  1. Place an order while auth + capture is enabled.
  2. Change the order status to Processing before capturing by either editing the order or bulk editing order statuses.
  3. Capture the order from Payments > Transactions > Uncaptured.
  4. Try to refund the order from Order details page.
  5. See an error: CleanShot 2024-05-14 at 22 57 45
vbelolapotkov commented 3 months ago

@deepakpathania routing this one to your team for further investigation and prioritization.