card_stop adding credit/debit class to non-cards (#2465)

* card_stop adding credit/debit class to non-cards

* Adding changeset file
This commit is contained in:
sponglord
2023-11-23 14:09:53 +01:00
committed by GitHub
parent 4e6f174da7
commit f461447e8b
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
---
'@adyen/adyen-web': patch
---
For all PaymentMethodItems we were adding a class `adyen-checkout__payment-method--{fundingSource}` (where fundingSource was either "credit" or "debit")
This is meant to be a Card PM specific class to indicate, in the paymentMethods list, whether the card is a credit or debit card.

View File

@@ -71,11 +71,13 @@ class PaymentMethodItem extends Component<PaymentMethodItemProps> {
return null;
}
const isCard = paymentMethod.props.type === 'card' || paymentMethod.props.type === 'scheme';
const paymentMethodClassnames = classNames({
'adyen-checkout__payment-method': true,
[styles['adyen-checkout__payment-method']]: true,
[`adyen-checkout__payment-method--${paymentMethod.props.type}`]: true,
[`adyen-checkout__payment-method--${paymentMethod.props.fundingSource ?? 'credit'}`]: true,
...(isCard && { [`adyen-checkout__payment-method--${paymentMethod.props.fundingSource ?? 'credit'}`]: true }),
'adyen-checkout__payment-method--selected': isSelected,
[styles['adyen-checkout__payment-method--selected']]: isSelected,
'adyen-checkout__payment-method--loading': isLoading,