diff --git a/src/CardUtils.res b/src/CardUtils.res index bcb9c8ea..9341d889 100644 --- a/src/CardUtils.res +++ b/src/CardUtils.res @@ -672,10 +672,6 @@ let getEligibleCoBadgedCardSchemes = (~matchedCardSchemes, ~enabledCardSchemes) }) } -let getCardBrandFromStates = (cardBrand, cardScheme, showFields, isNotBancontact) => { - switch (showFields, isNotBancontact) { - | (false, _) => cardScheme - | (_, true) => cardBrand - | _ => cardBrand - } +let getCardBrandFromStates = (cardBrand, cardScheme, showFields) => { + !showFields ? cardScheme : cardBrand } diff --git a/src/Payment.res b/src/Payment.res index 6b159e8b..f549921d 100644 --- a/src/Payment.res +++ b/src/Payment.res @@ -56,12 +56,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => { !showFields && isNotBancontact ? cardScheme : cardBrand ) - let cardBrand = CardUtils.getCardBrandFromStates( - cardBrand, - cardScheme, - showFields, - isNotBancontact, - ) + let cardBrand = CardUtils.getCardBrandFromStates(cardBrand, cardScheme, showFields) let supportedCardBrands = React.useMemo(() => { paymentMethodListValue->PaymentUtils.getSupportedCardBrands }, [paymentMethodListValue])