Adyen / adyen-magento2

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

[ECP-8788] Required field 'recurringProcessingModel' is not provided during using saved cc payment #2362

Closed Winfle closed 9 months ago

Winfle commented 11 months ago

Describe the bug When attempting to make a recurring payment on Magento Adyen, an error occurs. After selecting a stored credit card from the dropdown and clicking "Place order," the message "Error with payment method, please select a different payment method" is displayed. Adyen info log: AdyenLoggerTest.INFO: Request to Adyen API /payments {"apiVersion":"v70","livePrefix":"","body":{"shopperReference":"","reference":"***"}} {"uid":"9957baf"}

Magento logs: [2023-11-22T07:28:07.465879+00:00] AdyenLoggerTest.ERROR: Required field 'recurringProcessingModel' is not provided. [] {"uid":"9957baf"}

To Reproduce Customer has a saved cc Customer select the saved cc Customer click on "Place order" The order is not placed and the message "Error with payment method, please select a different payment method" appeared

Expected behavior Customer should be able to create an order using save cc

Magento version Magento 2.4.6-p3

Plugin version 8.22.4

Desktop (please complete the following information):

Additional context Card Tokenization is ON/OFF, doesn't affect the result

khushboo-singhvi commented 11 months ago

Hello @Winfle,

Thank you for reaching out! 👋

I've noticed that you're working on setting up recurring payments using a saved credit card. Just a quick check: are you currently using CVC off for tokenized payments? If that's the case, keep in mind that Adyen enforces card token payments to utilize CVC if the RPM is CardOnFile for Checkout API v70 or greater. Adyen considers card (token) payments with CardOnFile + ContAuth as OneClick, and such payments require shopper interaction.

To address this, there are two potential solutions:

You can experiment with setting the ADP skipCVCForOneClick parameter to true in CustomerArea. Alternatively, you may consider using UnscheduledCardOnFile as the RPM. Feel free to give these a try, and if you encounter any further issues or have additional questions, I'm here to assist.

Best regards, Khushboo

Winfle commented 11 months ago

@khushboo-singhvi Hey. After implementing additional loggers, I can see, that it doesn’t want to assign recurring payment model, because related vault details object (vault_payment_token.details) has no tokenType property: image

It can be a result of migration from previous Adyen Version, as this card has been stored before (soime time ago). Can you please confirm my theory? Additional links: https://github.com/Adyen/adyen-magento2/blob/74d15b4c4248faa511a7fb2fec3d6b0fe0ad61bb/Gateway/Request/RecurringVaultDataBuilder.php#L46 as the place where I think, assigning should be done.

Unfortunately, I don’t really know since what version it stopped to be working, because we made around 8 Adyen upgrades during last year. But, I think, it could be happened between versions, when tokenType was introduced.

From what I see, tokenType is present only for vault tokens that are created within THIS version. Seems like, old saved tokens are affected by this issue, because they don’t have tokenType stored in their details object.

It MIGHT be a serious problem for us. But that’s only theory. Also, I’ve saved cc, then removed tokenType from details object in DB (to simulate old tokens) and received the same behaviour as described in the issue:

image

I raised a ticket with Support team

candemiralp commented 11 months ago

Hello @Winfle,

We've created an internal ticket to solve this issue. You will be updated when the issue has been resolved.

Best Regards, Can