Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return URL #711

Open
maxout opened this issue Feb 19, 2024 · 2 comments
Open

Wrong return URL #711

maxout opened this issue Feb 19, 2024 · 2 comments

Comments

@maxout
Copy link

maxout commented Feb 19, 2024

Hi guys, I am using Shopware headless with a nextjs strorefront. Mollie works as it should. but now I have set up a staging instance. the store-api is now accessible at https://mydomain.com/stage/store-api/. When I now initiate a payment, I am correctly redirected to the mollie payment page. but after the payment I am redirected to https://mydomain.com/stage/stage/api/mollie/payment/return/018da7b419aa72c08e1173e57f5adf5a
why? where does the double stage come from? does anyone have an idea?
Thanks in advance

@fjbender
Copy link
Contributor

I don't have an idea straight away, but I think you should find the culprit pretty quickly by starting debugging at

public function buildReturnUrl(string $transactionId): string
{
$isStoreApiCall = $this->routingDetector->isStoreApiRoute();
$params = [
self::ROUTE_PARAM_RETURN_ID => $transactionId
];
# only go to an API domain if we are working in headless scopes.
# otherwise stick with the existing storefront route.
# if we do not do this, we have weird redirect problems.
# important is, that we only update the domains in case of custom domains
# if we are in the headless scope, storefront should always be as it is.
if ($isStoreApiCall) {
$redirectUrl = $this->router->generate('api.mollie.payment-return', $params, $this->router::ABSOLUTE_URL);
$redirectUrl = $this->applyAdminDomain($redirectUrl);
} else {
$redirectUrl = $this->router->generate('frontend.mollie.payment', $params, $this->router::ABSOLUTE_URL);
}
return (string)$redirectUrl;
}

@boxblinkracer
Copy link
Collaborator

Hi

it just used the symfony router as far as i can remember, as @fjbender already wrote.
but it also uses an overwrite-combination from the HOST of the .env file in Shopware
maye you have a weird value in there?

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

No branches or pull requests

3 participants