-
Notifications
You must be signed in to change notification settings - Fork 35
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
feature: added possibility to have a proxied webhook url #38
base: trunk
Are you sure you want to change the base?
Conversation
paypal: | ||
webhook_proxy_url: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you do one more layer? so
paypal:
webhook:
proxy_url: null
Background: we will in a future iteration, add more config parameters to the yaml files, therefore we would like to have some sort of namespacing
if ($this->proxyWebhookUrl !== null) { | ||
$webhookUrl = $this->proxyWebhookUrl . '?' . http_build_query( | ||
[self::PAYPAL_WEBHOOK_TOKEN_NAME => $webhookExecuteToken] | ||
); | ||
} else { | ||
$this->router->getContext()->setScheme('https'); | ||
$webhookUrl = $this->router->generate( | ||
'api.action.paypal.webhook.execute', | ||
[self::PAYPAL_WEBHOOK_TOKEN_NAME => $webhookExecuteToken], | ||
UrlGeneratorInterface::ABSOLUTE_URL | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please outsource this into an extra private method? So we don't have the duplicate code?
UrlGeneratorInterface::ABSOLUTE_URL | ||
); | ||
if ($this->proxyWebhookUrl !== null) { | ||
$webhookUrl = $this->proxyWebhookUrl . '?' . http_build_query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the proxy already contains GET parameters? Maybe do a str_contains('?') ? '&' : '?'
(overly simplified)
@jhony1104 any updates here? are you going to implement the suggested changes? |
The reason for this pr is a structure where shopware is not accessible from the internet. Only required endpoints are to be routed to shopware (
/store-api/
, WebHooks, ...) using a proxy.This PR is to make this possible for SwagPayPal.