Skip to content

Fix fetching proper configuration#3298

Open
mtytula wants to merge 3 commits into
Adyen:mainfrom
mtytula:fix_return_redirect
Open

Fix fetching proper configuration#3298
mtytula wants to merge 3 commits into
Adyen:mainfrom
mtytula:fix_return_redirect

Conversation

@mtytula
Copy link
Copy Markdown
Contributor

@mtytula mtytula commented Apr 27, 2026

Description
Fix redirect configuration being fetched from the wrong store when the current store context differs from the order's store.

The $storeId was initialized from $this->storeManager->getStore()->getId(), which reflects the current store context at the time of the return request — not necessarily the store the order was placed on. In multi-store setups (e.g.
different store views per language/region), this caused custom_success_redirect_path and return_path to be read from the wrong store's configuration.

Two corrections applied in Controller/Return/Index.php:

  1. Before reading success/fail paths — override $storeId with the order's store if they differ.
  2. Before checking custom_success_redirect_path for redirect params — override $storeId with the quote's store if they differ.

Tested scenarios

  • Single-store setup: redirect paths resolve correctly as before
  • Multi-store setup: return from Adyen redirect payment uses correct store's custom_success_redirect_path and return_path configuration
  • Verified no regression on standard checkout success redirect
  • Unit tests passing: vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/adyen/module-payment/Test/

Fixes
#3299

@mtytula mtytula requested a review from a team as a code owner April 27, 2026 12:34
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the store ID assignment logic in Controller/Return/Index.php to ensure the correct store context is used when retrieving redirect configurations. The review feedback identifies redundant ternary operations in both instances where $storeId is updated, recommending direct assignments to improve code clarity and efficiency.

Comment thread Controller/Return/Index.php Outdated
Comment thread Controller/Return/Index.php Outdated
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.

1 participant