Skip to content

[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
aashishgurung merged 4 commits intomasterfrom
feature/FRON-1599
Jun 28, 2022
Merged

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

Conversation

@aashishgurung
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Updated. Thanks.

@tanawin-opn
Copy link
Copy Markdown

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