[FRON-1599]: Fixed the issue of order status changing to failed when we try to capture a charge that's already been captured. #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: