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

NotificationReceiverController - Should use custom RouteScope so it works with headless sales channels as well #261

Closed
AndreasA opened this issue Jun 2, 2022 · 2 comments

Comments

@AndreasA
Copy link
Contributor

AndreasA commented Jun 2, 2022

Describe the bug
With multiple sales channels the NotificationReceiverController would require a corresponding Storefront sales channel with a correct domain configuration. It will not work for headless sales channels and it might also be tricky regarding which URL to use if the sales channel has multiple or one uses the same adyen configuration for multiple sales channels.

Instead if would make more sense to either use the admin API ACL definitions with a corresponding permission
or a custom route scope defintion.
The custom route scope is probably the way to go as you can define it for the adyen prefix, and can create your own authentication which you probably need for the web hooks. It should optionally be possible to specify the sales channel ID in the URL, e.g. as query parameter or suffix.

It would probably be necessary

Versions
Shopware version: 6.4.11.1
Plugin version: 3.4.1

@AndreasA AndreasA changed the title Adyen\Shopware\Storefront\Controller\NotificationReceiverController - Should use custom RouteScope so it does not require a corresponding sales channel domain NotificationReceiverController - Should use custom RouteScope so it works with headless sales channels as well Jun 2, 2022
@adyen-integrations-support

Hi @AndreasA ,

Thank you for reaching out to us. We have received your ticket and will review it promptly. Our team will analyze the details and get back to you with further updates as soon as possible.

If you have any additional information or questions in the meantime, please feel free to share them.

Thank you for your patience and understanding.

Best regards

@adyen-integrations-support

Hi @AndreasA ,

The Adyen plugin uses the sw-sales-channel-id request attribute set by Shopware framework to determine the sales channel for the webhooks requests. Shopware sets the sw-sales-channel-id request based on the request URL by matching the configured domains of a sales channel with the request domain.

Once the sales channel is determined from the webhooks request, the plugin will perform HMAC and username/password authentication based on plugin configuration values. Please note that you can set up different configuration values for each sales channel.

Please note that Adyen plugin exposes store API endpoints to enable building a custom front end for your headless Shopware 6 integration using either Adyen's pre-built UI solutions or your own UI. Your front end connects to your existing back end that uses Shopware's Store API endpoints (more details can be found here).

Based on the above, the plugin behavior behind the NotificationReceiverController is in line with its purpose of handling webhooks from Adyen.

Please let us know if you need further assistance or if there’s anything else we can do to support you.

Best regards

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