Fix the issue of order status changing from processing to failed when user tries to capture a charge that's already been captured.
Jira Ticket: #1599
2. Description of change
A logic is added to delete the capture metadata only if failed_capture and expired_charge error codes are present because we don't to delete it for 400, 401, 403, and 500 errors. The order status will be changed to failed only if the error code is expired_charge.
3. Quality assurance
Use manual capture (Card, Google Pay, or Rabbit LinePay)
Add items to cart and pay via card, Google pay or Rabbit LinePay
Check the order status. It should be processing.
Go to Omise dashboard and capture the charge
Go to the order in woocommerce and try to capture it. (See ticket description for image reference)
You should see Omise: Payment failed (manual capture). charge was already captured in the order note
Check the order status. It should be processing, not failed.
1. Objective
Fix the issue of order status changing from processing to failed when user tries to capture a charge that's already been captured. Jira Ticket: #1599
2. Description of change
A logic is added to delete the capture metadata only if
failed_capture
andexpired_charge
error codes are present because we don't to delete it for 400, 401, 403, and 500 errors. The order status will be changed to failed only if the error code isexpired_charge
.3. Quality assurance
Omise: Payment failed (manual capture). charge was already captured
in the order note🔧 Environments: