Repository: juspay/hyperswitch
File: crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs (Rust)

Code before:
            .ok();

        let raw_card_type = ccard.card_network.clone().or(additional_card_network);

        let card_type = match raw_card_type.clone().and_then(get_cybersource_card_type) {
            Some(card_network) => Some(card_network.to_string()),
            None => ccard.get_card_issuer().ok().map(String::from),
        };

        let security_code = if item
            .router_data
            .request
            .get_optional_network_transaction_id()
            .is_some()
        {
            None
        } else {
            Some(ccard.card_cvc)
        };

        let is_cobadged_card = ccard
            .card_number
            .clone()
            .is_cobadged_card()
            .change_context(errors::ConnectorError::RequestEncodingFailed)
            .attach_printable("error while checking is_cobadged_card")?;

        let type_selection_indicator = if is_cobadged_card {
            Some("1".to_owned())
        } else {
            None
        };

        let payment_information = PaymentInformation::Cards(Box::new(CardPaymentInformation {
            card: Card {
                number: ccard.card_number,
                expiration_month: ccard.card_exp_month,
                expiration_year: ccard.card_exp_year,
                security_code,
                card_type: card_type.clone(),
                type_selection_indicator,
            },
        }));

        let processing_information = ProcessingInformation::try_from((
            item,
            None,
            raw_card_type.map(|network| network.to_string()),
        ))?;
        let client_reference_information = ClientReferenceInformation::from(item);
        let merchant_defined_information = item

Review comment (suggestion):
Nit: You can use `is_some_and()`, something like this should work.
```suggestion
            if card_type.is_some_and(|card_type| card_type == "001" || card_type == "002") {
```

Code after:
            .get_billing_email()
            .or(item.router_data.request.get_email())?;
        let bill_to = build_bill_to(item.router_data.get_optional_billing(), email)?;
        let order_information = OrderInformationWithBill::from((item, Some(bill_to)));

        let additional_card_network = item
            .router_data
            .request
            .get_card_network_from_additional_payment_method_data()
            .map_err(|err| {
                router_env::logger::info!(
                    "Error while getting card network from additional payment method data: {}",
                    err
                );
            })
            .ok();

        let raw_card_type = ccard.card_network.clone().or(additional_card_network);

        let card_type = match raw_card_type.clone().and_then(get_cybersource_card_type) {
            Some(card_network) => Some(card_network.to_string()),
            None => ccard.get_card_issuer().ok().map(String::from),
        };

        let pares_status =
            if card_type == Some("001".to_string()) || card_type == Some("002".to_string()) {
                Some(CybersourceParesStatus::AuthenticationSuccessful)
            } else {
                None
            };

        let security_code = if item
            .router_data
            .request
            .get_optional_network_transaction_id()
            .is_some()
        {
            None
        } else {
            Some(ccard.card_cvc)
        };

        let is_cobadged_card = ccard
            .card_number
            .clone()
            .is_cobadged_card()
            .change_context(errors::ConnectorError::RequestEncodingFailed)
            .attach_printable("error while checking is_cobadged_card")?;

        let type_selection_indicator = if is_cobadged_card {
            Some("1".to_owned())