PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

Fix creditcard cardholder is not saved on first entry #429

Closed mfickers closed 2 years ago

mfickers commented 2 years ago

This fixes https://github.com/PAYONE-GmbH/magento-2/issues/428

If the user has no saved cards, getSelectedSavedCardPan() will return undefined, causing the condition in line 71 to become true.

getSelectedCardholder() will return false if the user has no saved card selected, overwriting the actual cardholder value from the form with an incorrect value.

I've fixed this by including a check for useSaveDataMode(), which returns false if user has no saved cards yet.