adyen-shopware6 icon indicating copy to clipboard operation
adyen-shopware6 copied to clipboard

Headless sales channel - webhooks cannot be used

Open AndreasA opened this issue 2 years ago • 1 comments

Describe the bug The webhook notification receiver currently requires Storefront sales channels as its route scope is storefront.

It would be great if it could also be used for headless sales channels.

Necessary changes:

  • RouteScope chnages:
    • either use an API integration with corresponding ACL role.
    • create a custom route scope for adyen, so the old path can be used and keep the current authentication methods.
      • this might be the better solution as you can add the adyen routescope and storefront to ensure old webhooks will continue to work.
  • Somehow add an information regarding the sales channel to the webhook call, e.g. sales channel ID query parameter or header.
    • adding it optionally to the path might also be a solution, that way headless integrations can use the ID there, but for existing ones it will still work through the domain paths.

It will work for storefront sales channels that are also used headless, but for headless only sales channels it will fail.

Versions Shopware version: 6.5.3.3 Plugin version: 3.12.1

See https://github.com/Adyen/adyen-shopware6/blob/3.12.1/src/Storefront/Controller/NotificationReceiverController.php

AndreasA avatar Jul 20 '23 13:07 AndreasA

@peterojo I think this might actually be quite simple to fix, by e.g. creating a store api route that has auth required set to false, and the sales channel ID as path parameter (potentially optional parameter) and the sales channel ID passed to the notfication service, and then calls the notfiication service. that one should also work for storefront sales channels but using different routes could even be by design.

I could create a corresponding PR.

I would suggest something like /store-api/adyen/notification/<sales-channel-id>

AndreasA avatar Jul 27 '23 12:07 AndreasA