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

[PW-6518] Webhook Helper does not use Store ID to select Order

Open pmzandbergen opened this issue 2 years ago • 1 comments

https://github.com/Adyen/adyen-magento2/blob/49b5eaca8bdfa9bf03bf77e1d3f88542c21d8596/Helper/Webhook.php#L1890-L1892

The order is selected by the Increment ID only, without using a Store ID. While this will work OK in most cases, you should filter by Store ID as well since the Order Increment ID is not necessarily unique in a multi-store environment. Example:

        $searchCriteria = $this->searchCriteriaBuilder
            ->addFilter('increment_id', $incrementId)
            ->addFilter('store_id', $storeId)
            ->create();

Note: You might need to update your Notification model to keep track of the Store ID.

pmzandbergen avatar Apr 01 '22 13:04 pmzandbergen

Hi @pmzandbergen,

Thank you for opening this issue. I have opened a ticket and we will be investigating the behaviour of our webhooks in a multi-store environment.

Cheers, Titus

tnaber avatar Apr 06 '22 14:04 tnaber

Hi @pmzandbergen,

Apologies for the delay. Although it's true that the increment ID is not necessarily unique, Magento by default utilizes this pattern to generate the increment ID, which uses $this->meta->getActiveProfile()->getPrefix() to differentiate between different stores.

Hence, if this default functionality is correctly overridden, it should be the admin's responsibility to ensure that the generated increment ID differentiates orders between different stores.

From our end it is not possible to specify the store ID as a separate field in the webhook, since ultimately this is functionality that is used by all Adyen merchants, not just Magento 2 users.

Regards, Jean Adyen

Morerice avatar Nov 07 '22 10:11 Morerice