Adyen / adyen-shopware5

MIT License
11 stars 12 forks source link

[PW-4602] Selecting Adyen method impossible for user without attributes #41

Closed runelaenen closed 3 years ago

runelaenen commented 4 years ago

Describe the bug Before a user has any attributes/freetextfields set, the adyen plugin cannot select the correct Adyen method. This is because it updates the _attributes value, but does not insert it if it does not exist yet for the user.

https://github.com/Adyen/adyen-shopware5/blob/c61c8ad1f7466e3975cfd7898060c9ac28333c08/Components/PaymentMethodService.php#L124-L133

To Reproduce Steps to reproduce the behavior:

  1. Login as a user without a row in s_user_attributes
  2. Add something to cart
  3. Change payment method to Adyen method
  4. It has not been selected

Expected behavior The payment method is selected and is remembered.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context If user accounts are created before the systems knows of any attributes for user accounts, it will not create the entry in the s_user_attributes table. So this issue will only happen on 'old' accounts in newer environments.

peterojo commented 3 years ago

Hello @runelaenen thanks for reporting this issue, and sorry for the delay. We will investigate and update this issue when we find a fix.