adyen-shopware6
adyen-shopware6 copied to clipboard
[PW-6019] Add option to easily provide `additionalData.RequestedTestAcquirerResponseCode` to test payment errors
Describe the bug
In order to test all possible payment errors, it is possible to be able to specify additionalData.RequestedTestAcquirerResponseCode
in the \Adyen\Shopware\Handlers\AbstractPaymentMethodHandler::preparePaymentsRequest
method.
According to documentation: https://docs.adyen.com/development-resources/test-cards/result-code-testing/adyen-response-codes
Best would be to add the information somehow with the payment-details request or maybe automatically convert the holder name to the correct value that way it can be entered in the credit card form.
It cannot be set currently that way because all additional data is overridden here: https://github.com/Adyen/adyen-shopware6/blob/develop/src/Service/PaymentStateDataService.php#L82 and in the php api library the CheckoutStateDataValidator removes it, if not set after calling it: https://github.com/Adyen/adyen-php-api-library/blob/develop/src/Adyen/Service/Validator/CheckoutStateDataValidator.php
I tried the card holder option. However, not all error codes seem to provide the correct refusal code with the holder name. a lot just result in FRAUD instead of the corresponding refusal code but e.g. differentiating between refused and ERROR
works with the holder name too.
@peterojo Will this also be part of the fix for https://github.com/Adyen/adyen-shopware6/issues/209 https://github.com/Adyen/adyen-shopware6/pull/236
or at least part of that release?
@AndreasA no it will not
@AndreasA no it will not
Thanks for letting me know. This one isn't that important anyway. Way more important is the one that provides the reason code in the store api 😄
can probably be fixed (for headless) by removing the checkoutstatevalidator which should not be used anymore anyway according to https://github.com/Adyen/adyen-php-api-library/issues/531#issuecomment-1735749828 and https://github.com/Adyen/adyen-php-api-library/issues/536#issuecomment-1735747796