Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 210 forks source link

Mutation adyenPaymentDetails - Support exception message #2056

Open dimitriBouteille opened 1 year ago

dimitriBouteille commented 1 year ago

Hi, It is possible to integrate this feature in version 9.0.0 ?

In the future, use the message and the code passed by the exception. Since currently the message and code are not being passed, use this generic message.

try {
            return $this->getAdyenPaymentStatusDataProvider->getGetAdyenPaymentDetails($this->jsonSerializer->serialize($payload));
        } catch (Exception $exception) {
            $this->adyenLogger->error(sprintf(
                'GraphQl payment details call failed with error message: %s',
                $exception->getMessage()
            ));
            // In the future, use the message and the code passed by the exception. Since currently the message and code are not
            // being passed, use this generic message.
            throw new GraphQlAdyenException(__('An unknown error has occurred'), null, 000);
        }

https://github.com/Adyen/adyen-magento2/blob/8ee726d9826398d83aaf97c340f0244168801e21/Model/Resolver/GetAdyenPaymentDetails.php#L126

RokPopov commented 1 year ago

Hi @dimitriBouteille,

Thank you for opening this issue.

Currently, the reason for logging the error but not showing any information about it in the frontend is of security nature.

We also have a similar issue open to differentiate between the failed and the cancelled orders which we are looking into (#1966). As we will have an update, we will make sure to communicate it here as well.

Kind regards, Rok