SL-380: Fix infinite spinner on fail - #337
Merged
justelis22 merged 2 commits intoJul 24, 2026
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Pull request overview
Updates the SaferPay fail front controller to proactively transition existing “pre-authorization” orders into a failed/canceled state, preventing the checkout status poller from spinning indefinitely after a rejected authorization.
Changes:
- Adds
markOrderAsFailed()call duringinitContent()to update PrestaShop order state and SaferPay order flags on failure. - Introduces logic to avoid overriding successful authorizations/captures while ensuring failed attempts don’t remain “awaiting payment”.
Comments suppressed due to low confidence (1)
controllers/front/fail.php:173
SaferPayOrderflags are only normalized whencanceledis false. If another flow already setcanceled = 1without clearingpending(e.g.failValidation.php), this method will skip clearingpending/authorized, leaving inconsistent state in the DB. Consider normalizing the flags when the record is still marked pending.
if (!$saferPayOrder->canceled) {
$saferPayOrder->authorized = false;
$saferPayOrder->pending = false;
$saferPayOrder->canceled = true;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Wrap the order state transition in Validate::isLoadedObject() so a missing/unloaded order row can no longer trigger setCurrentState() on an invalid object during the fail redirect flow, matching the guard already used in failValidation.php.
justelis22
merged commit Jul 24, 2026
b2376ab
into
feature/react-admin-settings
1 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Self-Checks
JIRA task link
Summary
QA Checklist Labels
QA Checklist
Additional Context
Frontend Changes