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

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

Merged
merged 4 commits into from
Jun 28, 2022

Conversation

aashishgurung
Copy link
Contributor

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

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

🔧 Environments:

  • WooCommerce: v6.4.1
  • WordPress: v5.9.3
  • PHP version: 7.3.33
  • Omise plugin version: Omise-WooCommerce 4.21.1

…we try to capture a charge that's already been captured.
Copy link
Contributor

@som-m som-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@aashishgurung
Copy link
Contributor Author

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

Updated. Thanks.

@tanawin-opn
Copy link

test and verified krub

@aashishgurung aashishgurung merged commit 765eb59 into master Jun 28, 2022
@aashishgurung aashishgurung deleted the feature/FRON-1599 branch August 29, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants