omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[FRON-1599]: Fixed the issue of order status changing to failed when we try to capture a charge that's already been captured. #281

Closed aashishgurung closed 2 years ago

aashishgurung commented 2 years ago

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 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

🔧 Environments:

aashishgurung commented 2 years ago

I think for expired charges, the order status should be updated to Cancelled. Otherwise 👍

Updated. Thanks.

tanawin-opn commented 2 years ago

test and verified krub