Skip to content

SL-380: Fix infinite spinner on fail - #337

Merged
justelis22 merged 2 commits into
feature/react-admin-settingsfrom
SL-380/infinite-spinner-fix
Jul 24, 2026
Merged

SL-380: Fix infinite spinner on fail#337
justelis22 merged 2 commits into
feature/react-admin-settingsfrom
SL-380/infinite-spinner-fix

Conversation

@justelis22

@justelis22 justelis22 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Self-Checks

  • I have performed a self-review of my code.
  • I have updated/added necessary technical documentation in the README file.

JIRA task link

Summary

QA Checklist Labels

  • Bug fix?
  • New feature?
  • Improvement?
  • Technical debt?
  • Reusable?
  • Covered by tests?

QA Checklist

Additional Context

Frontend Changes

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 during initContent() 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

  • SaferPayOrder flags are only normalized when canceled is false. If another flow already set canceled = 1 without clearing pending (e.g. failValidation.php), this method will skip clearing pending/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.

Comment thread controllers/front/fail.php
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
justelis22 merged commit b2376ab into feature/react-admin-settings Jul 24, 2026
1 of 3 checks passed
@justelis22
justelis22 deleted the SL-380/infinite-spinner-fix branch July 24, 2026 09:12
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.

2 participants