From 47f68859b3c4c5558b57f5cb6d52dcc5427ef76c Mon Sep 17 00:00:00 2001 From: Debarati Ghatak <88573135+dgeee13@users.noreply.github.com> Date: Thu, 28 Aug 2025 17:54:33 +0530 Subject: [PATCH] fix(connector): [CYBERSOURCE] Fix transaction_type for Googlepay payments (#9071) Co-authored-by: Debarati Ghatak --- .../connectors/cybersource/transformers.rs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs index 42bc6f9287..72b596f1d4 100644 --- a/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs +++ b/crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs @@ -271,6 +271,9 @@ impl TryFrom<&SetupMandateRouterData> for CybersourceZeroMandateRequest { ), descriptor: None, }, + tokenized_card: GooglePayTokenizedCard { + transaction_type: TransactionType::InApp, + }, }, )), Some(PaymentSolution::GooglePay), @@ -552,10 +555,17 @@ pub struct ApplePayPaymentInformation { tokenized_card: TokenizedCard, } +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct MandatePaymentTokenizedCard { + transaction_type: TransactionType, +} + #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] pub struct MandatePaymentInformation { payment_instrument: CybersoucrePaymentInstrument, + tokenized_card: MandatePaymentTokenizedCard, } #[derive(Debug, Serialize)] @@ -574,6 +584,13 @@ pub const FLUID_DATA_DESCRIPTOR_FOR_SAMSUNG_PAY: &str = "FID=COMMON.SAMSUNG.INAP #[serde(rename_all = "camelCase")] pub struct GooglePayTokenPaymentInformation { fluid_data: FluidData, + tokenized_card: GooglePayTokenizedCard, +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct GooglePayTokenizedCard { + transaction_type: TransactionType, } #[derive(Debug, Serialize)] @@ -2064,6 +2081,9 @@ impl ), descriptor: None, }, + tokenized_card: GooglePayTokenizedCard { + transaction_type: TransactionType::InApp, + }, })); let processing_information = ProcessingInformation::try_from((item, Some(PaymentSolution::GooglePay), None))?; @@ -2542,6 +2562,9 @@ impl TryFrom<(&CybersourceRouterData<&PaymentsAuthorizeRouterData>, String)> let payment_information = PaymentInformation::MandatePayment(Box::new(MandatePaymentInformation { payment_instrument, + tokenized_card: MandatePaymentTokenizedCard { + transaction_type: TransactionType::StoredCredentials, + }, })); let client_reference_information = ClientReferenceInformation::from(item); let merchant_defined_information = item