From 0824c5d06bd89bd030a0916753a1a9fdd687c777 Mon Sep 17 00:00:00 2001 From: taksh Date: Fri, 19 Apr 2024 14:15:23 +0530 Subject: [PATCH 1/7] Add support for Ideal and Giropay bank redirect in Multisafepay connector --- .../connector/multisafepay/transformers.rs | 82 ++++++++++++++++++- crates/router/src/types/api/payments.rs | 16 ++-- 2 files changed, 88 insertions(+), 10 deletions(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index f6051ea05de..e82a5b5d96b 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -1,3 +1,4 @@ +use api_models::enums::BankNames; use common_utils::pii::{Email, IpAddress}; use masking::ExposeInterface; use serde::{Deserialize, Serialize}; @@ -63,6 +64,8 @@ pub enum Gateway { Klarna, Googlepay, Paypal, + Ideal, + Giropay, } #[serde_with::skip_serializing_none] @@ -173,6 +176,7 @@ pub enum GatewayInfo { Card(CardInfo), Wallet(WalletInfo), PayLater(PayLaterInfo), + BankRedirect(BankRedirectInfo), } #[derive(Clone, Debug, Eq, PartialEq, Serialize)] @@ -181,6 +185,46 @@ pub enum WalletInfo { GooglePay(GpayInfo), } +#[derive(Clone, Debug, Eq, PartialEq, Serialize)] +#[serde(untagged)] +pub enum BankRedirectInfo { + Ideal(IdealInfo), +} + +#[derive(Clone, Debug, Eq, PartialEq, Serialize)] +pub struct IdealInfo { + pub issuer_id: Option, +} + +pub struct MultisafepayBankNames<'a>(&'a str); + +impl<'a> TryFrom<&BankNames> for MultisafepayBankNames<'a> { + type Error = error_stack::Report; + fn try_from(bank: &BankNames) -> Result { + Ok(match bank { + BankNames::AbnAmro => Self("0031"), + BankNames::AsnBank => Self("0761"), + BankNames::Bunq => Self("4371"), + BankNames::Ing => Self("0721"), + BankNames::Knab => Self("0801"), + BankNames::N26 => Self("9926"), + BankNames::NationaleNederlanden => Self("9927"), + BankNames::Rabobank => Self("0021"), + BankNames::Regiobank => Self("0771"), + BankNames::Revolut => Self("1099"), + BankNames::SnsBank => Self("0751"), + BankNames::TriodosBank => Self("0511"), + BankNames::VanLanschot => Self("0161"), + BankNames::Yoursafe => Self("0806"), + BankNames::Handelsbanken => Self("1235"), + _ => Err(errors::ConnectorError::NotSupported { + message: String::from("BankRedirect"), + connector: "Multisafepay", + })?, + }) + } +} + #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] pub struct DeliveryObject { first_name: Secret, @@ -311,6 +355,13 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> ))?, }, api::PaymentMethodData::PayLater(ref _paylater) => Type::Redirect, + api::PaymentMethodData::BankRedirect(ref bank_data) => match bank_data { + api::BankRedirectData::Giropay { .. } => Type::Redirect, + api::BankRedirectData::Ideal { .. } => Type::Direct, + _ => Err(errors::ConnectorError::NotImplemented( + utils::get_unimplemented_payment_method_error_message("multisafepay"), + ))?, + }, _ => Type::Redirect, }; @@ -355,9 +406,15 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> }, ) => Some(Gateway::Klarna), api::PaymentMethodData::MandatePayment => None, + api::PaymentMethodData::BankRedirect(ref bank_data) => Some(match bank_data { + api::BankRedirectData::Giropay { .. } => Gateway::Giropay, + api::BankRedirectData::Ideal { .. } => Gateway::Ideal, + _ => Err(errors::ConnectorError::NotImplemented( + utils::get_unimplemented_payment_method_error_message("multisafepay"), + ))?, + }), api::PaymentMethodData::CardRedirect(_) | api::PaymentMethodData::PayLater(_) - | api::PaymentMethodData::BankRedirect(_) | api::PaymentMethodData::BankDebit(_) | api::PaymentMethodData::BankTransfer(_) | api::PaymentMethodData::Crypto(_) @@ -503,8 +560,29 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> })) } api::PaymentMethodData::MandatePayment => None, + api::PaymentMethodData::BankRedirect(ref bank_redirect_data) => { + match bank_redirect_data { + api::BankRedirectData::Ideal { + billing_details: _, + bank_name, + country: _, + } => Some(GatewayInfo::BankRedirect(BankRedirectInfo::Ideal( + IdealInfo { + issuer_id: Some( + MultisafepayBankNames::try_from(&bank_name.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "eps.bank_name", + }, + )?)? + .0 + .to_string(), + ), + }, + ))), + _ => None, + } + } api::PaymentMethodData::CardRedirect(_) - | api::PaymentMethodData::BankRedirect(_) | api::PaymentMethodData::BankDebit(_) | api::PaymentMethodData::BankTransfer(_) | api::PaymentMethodData::Crypto(_) diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs index 370e0ca3509..ebf7882d948 100644 --- a/crates/router/src/types/api/payments.rs +++ b/crates/router/src/types/api/payments.rs @@ -1,12 +1,12 @@ pub use api_models::payments::{ - AcceptanceType, Address, AddressDetails, Amount, AuthenticationForStartResponse, Card, - CryptoData, CustomerAcceptance, HeaderPayload, MandateAmountData, MandateData, - MandateTransactionType, MandateType, MandateValidationFields, NextActionType, OnlineMandate, - PayLaterData, PaymentIdType, PaymentListConstraints, PaymentListFilterConstraints, - PaymentListFilters, PaymentListResponse, PaymentListResponseV2, PaymentMethodData, - PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp, PaymentRetrieveBody, - PaymentRetrieveBodyWithCredentials, PaymentsApproveRequest, PaymentsCancelRequest, - PaymentsCaptureRequest, PaymentsExternalAuthenticationRequest, + AcceptanceType, Address, AddressDetails, Amount, AuthenticationForStartResponse, + BankRedirectData, Card, CryptoData, CustomerAcceptance, HeaderPayload, MandateAmountData, + MandateData, MandateTransactionType, MandateType, MandateValidationFields, NextActionType, + OnlineMandate, PayLaterData, PaymentIdType, PaymentListConstraints, + PaymentListFilterConstraints, PaymentListFilters, PaymentListResponse, PaymentListResponseV2, + PaymentMethodData, PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp, + PaymentRetrieveBody, PaymentRetrieveBodyWithCredentials, PaymentsApproveRequest, + PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsExternalAuthenticationRequest, PaymentsIncrementalAuthorizationRequest, PaymentsRedirectRequest, PaymentsRedirectionResponse, PaymentsRejectRequest, PaymentsRequest, PaymentsResponse, PaymentsResponseForm, PaymentsRetrieveRequest, PaymentsSessionRequest, PaymentsSessionResponse, PaymentsStartRequest, From b729cdda95e264cc61b317befa40af444de62a33 Mon Sep 17 00:00:00 2001 From: taksh Date: Mon, 22 Apr 2024 14:33:37 +0530 Subject: [PATCH 2/7] Updated default hands --- .../connector/multisafepay/transformers.rs | 194 +++++++++++++++++- 1 file changed, 185 insertions(+), 9 deletions(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index e82a5b5d96b..7418b573cf9 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -217,7 +217,136 @@ impl<'a> TryFrom<&BankNames> for MultisafepayBankNames<'a> { BankNames::VanLanschot => Self("0161"), BankNames::Yoursafe => Self("0806"), BankNames::Handelsbanken => Self("1235"), - _ => Err(errors::ConnectorError::NotSupported { + BankNames::AmericanExpress + | BankNames::AffinBank + | BankNames::AgroBank + | BankNames::AllianceBank + | BankNames::AmBank + | BankNames::BankOfAmerica + | BankNames::BankIslam + | BankNames::BankMuamalat + | BankNames::BankRakyat + | BankNames::BankSimpananNasional + | BankNames::Barclays + | BankNames::BlikPSP + | BankNames::CapitalOne + | BankNames::Chase + | BankNames::Citi + | BankNames::CimbBank + | BankNames::Discover + | BankNames::NavyFederalCreditUnion + | BankNames::PentagonFederalCreditUnion + | BankNames::SynchronyBank + | BankNames::WellsFargo + | BankNames::HongLeongBank + | BankNames::HsbcBank + | BankNames::KuwaitFinanceHouse + | BankNames::Moneyou + | BankNames::ArzteUndApothekerBank + | BankNames::AustrianAnadiBankAg + | BankNames::BankAustria + | BankNames::Bank99Ag + | BankNames::BankhausCarlSpangler + | BankNames::BankhausSchelhammerUndSchatteraAg + | BankNames::BankMillennium + | BankNames::BankPEKAOSA + | BankNames::BawagPskAg + | BankNames::BksBankAg + | BankNames::BrullKallmusBankAg + | BankNames::BtvVierLanderBank + | BankNames::CapitalBankGraweGruppeAg + | BankNames::CeskaSporitelna + | BankNames::Dolomitenbank + | BankNames::EasybankAg + | BankNames::EPlatbyVUB + | BankNames::ErsteBankUndSparkassen + | BankNames::FrieslandBank + | BankNames::HypoAlpeadriabankInternationalAg + | BankNames::HypoNoeLbFurNiederosterreichUWien + | BankNames::HypoOberosterreichSalzburgSteiermark + | BankNames::HypoTirolBankAg + | BankNames::HypoVorarlbergBankAg + | BankNames::HypoBankBurgenlandAktiengesellschaft + | BankNames::KomercniBanka + | BankNames::MBank + | BankNames::MarchfelderBank + | BankNames::Maybank + | BankNames::OberbankAg + | BankNames::OsterreichischeArzteUndApothekerbank + | BankNames::OcbcBank + | BankNames::PayWithING + | BankNames::PlaceZIPKO + | BankNames::PlatnoscOnlineKartaPlatnicza + | BankNames::PosojilnicaBankEGen + | BankNames::PostovaBanka + | BankNames::PublicBank + | BankNames::RaiffeisenBankengruppeOsterreich + | BankNames::RhbBank + | BankNames::SchelhammerCapitalBankAg + | BankNames::StandardCharteredBank + | BankNames::SchoellerbankAg + | BankNames::SpardaBankWien + | BankNames::SporoPay + | BankNames::SantanderPrzelew24 + | BankNames::TatraPay + | BankNames::Viamo + | BankNames::VolksbankGruppe + | BankNames::VolkskreditbankAg + | BankNames::VrBankBraunau + | BankNames::UobBank + | BankNames::PayWithAliorBank + | BankNames::BankiSpoldzielcze + | BankNames::PayWithInteligo + | BankNames::BNPParibasPoland + | BankNames::BankNowySA + | BankNames::CreditAgricole + | BankNames::PayWithBOS + | BankNames::PayWithCitiHandlowy + | BankNames::PayWithPlusBank + | BankNames::ToyotaBank + | BankNames::VeloBank + | BankNames::ETransferPocztowy24 + | BankNames::PlusBank + | BankNames::EtransferPocztowy24 + | BankNames::BankiSpbdzielcze + | BankNames::BankNowyBfgSa + | BankNames::GetinBank + | BankNames::Blik + | BankNames::NoblePay + | BankNames::IdeaBank + | BankNames::EnveloBank + | BankNames::NestPrzelew + | BankNames::MbankMtransfer + | BankNames::Inteligo + | BankNames::PbacZIpko + | BankNames::BnpParibas + | BankNames::BankPekaoSa + | BankNames::VolkswagenBank + | BankNames::AliorBank + | BankNames::Boz + | BankNames::BangkokBank + | BankNames::KrungsriBank + | BankNames::KrungThaiBank + | BankNames::TheSiamCommercialBank + | BankNames::KasikornBank + | BankNames::OpenBankSuccess + | BankNames::OpenBankFailure + | BankNames::OpenBankCancelled + | BankNames::Aib + | BankNames::BankOfScotland + | BankNames::DanskeBank + | BankNames::FirstDirect + | BankNames::FirstTrust + | BankNames::Halifax + | BankNames::Lloyds + | BankNames::Monzo + | BankNames::NatWest + | BankNames::NationwideBank + | BankNames::RoyalBankOfScotland + | BankNames::Starling + | BankNames::TsbBank + | BankNames::TescoBank + | BankNames::UlsterBank => Err(errors::ConnectorError::NotSupported { message: String::from("BankRedirect"), connector: "Multisafepay", })?, @@ -358,9 +487,25 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> api::PaymentMethodData::BankRedirect(ref bank_data) => match bank_data { api::BankRedirectData::Giropay { .. } => Type::Redirect, api::BankRedirectData::Ideal { .. } => Type::Direct, - _ => Err(errors::ConnectorError::NotImplemented( - utils::get_unimplemented_payment_method_error_message("multisafepay"), - ))?, + api::BankRedirectData::BancontactCard { .. } + | api::BankRedirectData::Bizum { .. } + | api::BankRedirectData::Blik { .. } + | api::BankRedirectData::Eps { .. } + | api::BankRedirectData::Interac { .. } + | api::BankRedirectData::OnlineBankingCzechRepublic { .. } + | api::BankRedirectData::OnlineBankingFinland { .. } + | api::BankRedirectData::OnlineBankingPoland { .. } + | api::BankRedirectData::OnlineBankingSlovakia { .. } + | api::BankRedirectData::OpenBankingUk { .. } + | api::BankRedirectData::Przelewy24 { .. } + | api::BankRedirectData::Sofort { .. } + | api::BankRedirectData::Trustly { .. } + | api::BankRedirectData::OnlineBankingFpx { .. } + | api::BankRedirectData::OnlineBankingThailand { .. } => { + Err(errors::ConnectorError::NotImplemented( + utils::get_unimplemented_payment_method_error_message("multisafepay"), + ))? + } }, _ => Type::Redirect, }; @@ -409,9 +554,25 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> api::PaymentMethodData::BankRedirect(ref bank_data) => Some(match bank_data { api::BankRedirectData::Giropay { .. } => Gateway::Giropay, api::BankRedirectData::Ideal { .. } => Gateway::Ideal, - _ => Err(errors::ConnectorError::NotImplemented( - utils::get_unimplemented_payment_method_error_message("multisafepay"), - ))?, + api::BankRedirectData::BancontactCard { .. } + | api::BankRedirectData::Bizum { .. } + | api::BankRedirectData::Blik { .. } + | api::BankRedirectData::Eps { .. } + | api::BankRedirectData::Interac { .. } + | api::BankRedirectData::OnlineBankingCzechRepublic { .. } + | api::BankRedirectData::OnlineBankingFinland { .. } + | api::BankRedirectData::OnlineBankingPoland { .. } + | api::BankRedirectData::OnlineBankingSlovakia { .. } + | api::BankRedirectData::OpenBankingUk { .. } + | api::BankRedirectData::Przelewy24 { .. } + | api::BankRedirectData::Sofort { .. } + | api::BankRedirectData::Trustly { .. } + | api::BankRedirectData::OnlineBankingFpx { .. } + | api::BankRedirectData::OnlineBankingThailand { .. } => { + Err(errors::ConnectorError::NotImplemented( + utils::get_unimplemented_payment_method_error_message("multisafepay"), + ))? + } }), api::PaymentMethodData::CardRedirect(_) | api::PaymentMethodData::PayLater(_) @@ -571,7 +732,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> issuer_id: Some( MultisafepayBankNames::try_from(&bank_name.ok_or( errors::ConnectorError::MissingRequiredField { - field_name: "eps.bank_name", + field_name: "ideal.bank_name", }, )?)? .0 @@ -579,7 +740,22 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> ), }, ))), - _ => None, + api::BankRedirectData::BancontactCard { .. } + | api::BankRedirectData::Bizum { .. } + | api::BankRedirectData::Blik { .. } + | api::BankRedirectData::Eps { .. } + | api::BankRedirectData::Giropay { .. } + | api::BankRedirectData::Interac { .. } + | api::BankRedirectData::OnlineBankingCzechRepublic { .. } + | api::BankRedirectData::OnlineBankingFinland { .. } + | api::BankRedirectData::OnlineBankingPoland { .. } + | api::BankRedirectData::OnlineBankingSlovakia { .. } + | api::BankRedirectData::OpenBankingUk { .. } + | api::BankRedirectData::Przelewy24 { .. } + | api::BankRedirectData::Sofort { .. } + | api::BankRedirectData::Trustly { .. } + | api::BankRedirectData::OnlineBankingFpx { .. } + | api::BankRedirectData::OnlineBankingThailand { .. } => None, } } api::PaymentMethodData::CardRedirect(_) From c495c6ac9e951e62aa09dbb2421bc6a545ce50ff Mon Sep 17 00:00:00 2001 From: taksh Date: Mon, 22 Apr 2024 18:48:59 +0530 Subject: [PATCH 3/7] Refactor payment method data types in Multisafepay connector --- .../connector/multisafepay/transformers.rs | 43 +++++++++---------- crates/router/src/types/api/payments.rs | 10 ++--- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 62b8fb0098b..0e490c7233b 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -484,25 +484,24 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> utils::get_unimplemented_payment_method_error_message("multisafepay"), ))?, }, - api::PaymentMethodData::PayLater(ref _paylater) => Type::Redirect, - api::PaymentMethodData::BankRedirect(ref bank_data) => match bank_data { - api::BankRedirectData::Giropay { .. } => Type::Redirect, - api::BankRedirectData::Ideal { .. } => Type::Direct, - api::BankRedirectData::BancontactCard { .. } - | api::BankRedirectData::Bizum { .. } - | api::BankRedirectData::Blik { .. } - | api::BankRedirectData::Eps { .. } - | api::BankRedirectData::Interac { .. } - | api::BankRedirectData::OnlineBankingCzechRepublic { .. } - | api::BankRedirectData::OnlineBankingFinland { .. } - | api::BankRedirectData::OnlineBankingPoland { .. } - | api::BankRedirectData::OnlineBankingSlovakia { .. } - | api::BankRedirectData::OpenBankingUk { .. } - | api::BankRedirectData::Przelewy24 { .. } - | api::BankRedirectData::Sofort { .. } - | api::BankRedirectData::Trustly { .. } - | api::BankRedirectData::OnlineBankingFpx { .. } - | api::BankRedirectData::OnlineBankingThailand { .. } => { + domain::PaymentMethodData::BankRedirect(ref bank_data) => match bank_data { + domain::BankRedirectData::Giropay { .. } => Type::Redirect, + domain::BankRedirectData::Ideal { .. } => Type::Direct, + domain::BankRedirectData::BancontactCard { .. } + | domain::BankRedirectData::Bizum { .. } + | domain::BankRedirectData::Blik { .. } + | domain::BankRedirectData::Eps { .. } + | domain::BankRedirectData::Interac { .. } + | domain::BankRedirectData::OnlineBankingCzechRepublic { .. } + | domain::BankRedirectData::OnlineBankingFinland { .. } + | domain::BankRedirectData::OnlineBankingPoland { .. } + | domain::BankRedirectData::OnlineBankingSlovakia { .. } + | domain::BankRedirectData::OpenBankingUk { .. } + | domain::BankRedirectData::Przelewy24 { .. } + | domain::BankRedirectData::Sofort { .. } + | domain::BankRedirectData::Trustly { .. } + | domain::BankRedirectData::OnlineBankingFpx { .. } + | domain::BankRedirectData::OnlineBankingThailand { .. } => { Err(errors::ConnectorError::NotImplemented( utils::get_unimplemented_payment_method_error_message("multisafepay"), ))? @@ -550,7 +549,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> billing_email: _, billing_country: _, }) => Some(Gateway::Klarna), - domain::PaymentMethodData::BankRedirect(ref bank_data) => Some(match bank_data { + domain::PaymentMethodData::BankRedirect(ref bank_data) => Some(match bank_data { domain::BankRedirectData::Giropay { .. } => Gateway::Giropay, domain::BankRedirectData::Ideal { .. } => Gateway::Ideal, domain::BankRedirectData::BancontactCard { .. } @@ -576,7 +575,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> domain::PaymentMethodData::MandatePayment => None, domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::PayLater(_) - | domain::PaymentMethodData::BankRedirect(_) + | domain::PaymentMethodData::BankDebit(_) | domain::PaymentMethodData::BankTransfer(_) | domain::PaymentMethodData::Crypto(_) | domain::PaymentMethodData::Reward @@ -727,7 +726,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> } domain::PaymentMethodData::BankRedirect(ref bank_redirect_data) => { match bank_redirect_data { - api::BankRedirectData::Ideal { + domain::BankRedirectData::Ideal { billing_details: _, bank_name, country: _, diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs index ebf7882d948..4fc3fb44521 100644 --- a/crates/router/src/types/api/payments.rs +++ b/crates/router/src/types/api/payments.rs @@ -1,9 +1,9 @@ pub use api_models::payments::{ - AcceptanceType, Address, AddressDetails, Amount, AuthenticationForStartResponse, - BankRedirectData, Card, CryptoData, CustomerAcceptance, HeaderPayload, MandateAmountData, - MandateData, MandateTransactionType, MandateType, MandateValidationFields, NextActionType, - OnlineMandate, PayLaterData, PaymentIdType, PaymentListConstraints, - PaymentListFilterConstraints, PaymentListFilters, PaymentListResponse, PaymentListResponseV2, + AcceptanceType, Address, AddressDetails, Amount, AuthenticationForStartResponse, Card, + CryptoData, CustomerAcceptance, HeaderPayload, MandateAmountData, MandateData, + MandateTransactionType, MandateType, MandateValidationFields, NextActionType, OnlineMandate, + PayLaterData, PaymentIdType, PaymentListConstraints, PaymentListFilterConstraints, + PaymentListFilters, PaymentListFiltersV2, PaymentListResponse, PaymentListResponseV2, PaymentMethodData, PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp, PaymentRetrieveBody, PaymentRetrieveBodyWithCredentials, PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsExternalAuthenticationRequest, From d125f9a7b01a223ea262b3bca3ab8c59486744fa Mon Sep 17 00:00:00 2001 From: taksh Date: Fri, 26 Apr 2024 16:01:45 +0530 Subject: [PATCH 4/7] Convert MultisafepayBankNames to enum --- .../connector/multisafepay/transformers.rs | 91 ++++++++++++------- 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 0e490c7233b..b0e709d4ed7 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -192,32 +192,64 @@ pub enum BankRedirectInfo { Ideal(IdealInfo), } -#[derive(Clone, Debug, Eq, PartialEq, Serialize)] +#[derive(Debug, Clone, Serialize, Eq, PartialEq)] pub struct IdealInfo { - pub issuer_id: Option, + pub issuer_id: MultisafepayBankNames, } -pub struct MultisafepayBankNames<'a>(&'a str); +#[derive(Debug, Clone, Serialize, Eq, PartialEq)] +pub enum MultisafepayBankNames { + #[serde(rename = "0031")] + AbnAmro, + #[serde(rename = "0761")] + AsnBank, + #[serde(rename = "4371")] + Bunq, + #[serde(rename = "0721")] + Ing, + #[serde(rename = "0801")] + Knab, + #[serde(rename = "9926")] + N26, + #[serde(rename = "9927")] + NationaleNederlanden, + #[serde(rename = "0021")] + Rabobank, + #[serde(rename = "0771")] + Regiobank, + #[serde(rename = "1099")] + Revolut, + #[serde(rename = "0751")] + SnsBank, + #[serde(rename = "0511")] + TriodosBank, + #[serde(rename = "0161")] + VanLanschot, + #[serde(rename = "0806")] + Yoursafe, + #[serde(rename = "1235")] + Handelsbanken, +} -impl<'a> TryFrom<&BankNames> for MultisafepayBankNames<'a> { +impl TryFrom<&BankNames> for MultisafepayBankNames { type Error = error_stack::Report; fn try_from(bank: &BankNames) -> Result { - Ok(match bank { - BankNames::AbnAmro => Self("0031"), - BankNames::AsnBank => Self("0761"), - BankNames::Bunq => Self("4371"), - BankNames::Ing => Self("0721"), - BankNames::Knab => Self("0801"), - BankNames::N26 => Self("9926"), - BankNames::NationaleNederlanden => Self("9927"), - BankNames::Rabobank => Self("0021"), - BankNames::Regiobank => Self("0771"), - BankNames::Revolut => Self("1099"), - BankNames::SnsBank => Self("0751"), - BankNames::TriodosBank => Self("0511"), - BankNames::VanLanschot => Self("0161"), - BankNames::Yoursafe => Self("0806"), - BankNames::Handelsbanken => Self("1235"), + match bank { + BankNames::AbnAmro => Ok(MultisafepayBankNames::AbnAmro), + BankNames::AsnBank => Ok(MultisafepayBankNames::AsnBank), + BankNames::Bunq => Ok(MultisafepayBankNames::Bunq), + BankNames::Ing => Ok(MultisafepayBankNames::Ing), + BankNames::Knab => Ok(MultisafepayBankNames::Knab), + BankNames::N26 => Ok(MultisafepayBankNames::N26), + BankNames::NationaleNederlanden => Ok(MultisafepayBankNames::NationaleNederlanden), + BankNames::Rabobank => Ok(MultisafepayBankNames::Rabobank), + BankNames::Regiobank => Ok(MultisafepayBankNames::Regiobank), + BankNames::Revolut => Ok(MultisafepayBankNames::Revolut), + BankNames::SnsBank => Ok(MultisafepayBankNames::SnsBank), + BankNames::TriodosBank => Ok(MultisafepayBankNames::TriodosBank), + BankNames::VanLanschot => Ok(MultisafepayBankNames::VanLanschot), + BankNames::Yoursafe => Ok(MultisafepayBankNames::Yoursafe), + BankNames::Handelsbanken => Ok(MultisafepayBankNames::Handelsbanken), BankNames::AmericanExpress | BankNames::AffinBank | BankNames::AgroBank @@ -350,8 +382,9 @@ impl<'a> TryFrom<&BankNames> for MultisafepayBankNames<'a> { | BankNames::UlsterBank => Err(errors::ConnectorError::NotSupported { message: String::from("BankRedirect"), connector: "Multisafepay", - })?, - }) + }) + .map_err(Into::into), + } } } @@ -732,15 +765,11 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> country: _, } => Some(GatewayInfo::BankRedirect(BankRedirectInfo::Ideal( IdealInfo { - issuer_id: Some( - MultisafepayBankNames::try_from(&bank_name.ok_or( - errors::ConnectorError::MissingRequiredField { - field_name: "ideal.bank_name", - }, - )?)? - .0 - .to_string(), - ), + issuer_id: MultisafepayBankNames::try_from(&bank_name.ok_or( + errors::ConnectorError::MissingRequiredField { + field_name: "ideal.bank_name", + }, + )?)?, }, ))), domain::BankRedirectData::BancontactCard { .. } From 7ad9ab8d755ac1347a515cc0d9710a9f9bed981e Mon Sep 17 00:00:00 2001 From: taksh Date: Fri, 26 Apr 2024 16:27:09 +0530 Subject: [PATCH 5/7] Refactor MultisafepayBankNames enum in transformer.rs --- .../connector/multisafepay/transformers.rs | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index b0e709d4ed7..d2af5043ce7 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -235,21 +235,21 @@ impl TryFrom<&BankNames> for MultisafepayBankNames { type Error = error_stack::Report; fn try_from(bank: &BankNames) -> Result { match bank { - BankNames::AbnAmro => Ok(MultisafepayBankNames::AbnAmro), - BankNames::AsnBank => Ok(MultisafepayBankNames::AsnBank), - BankNames::Bunq => Ok(MultisafepayBankNames::Bunq), - BankNames::Ing => Ok(MultisafepayBankNames::Ing), - BankNames::Knab => Ok(MultisafepayBankNames::Knab), - BankNames::N26 => Ok(MultisafepayBankNames::N26), - BankNames::NationaleNederlanden => Ok(MultisafepayBankNames::NationaleNederlanden), - BankNames::Rabobank => Ok(MultisafepayBankNames::Rabobank), - BankNames::Regiobank => Ok(MultisafepayBankNames::Regiobank), - BankNames::Revolut => Ok(MultisafepayBankNames::Revolut), - BankNames::SnsBank => Ok(MultisafepayBankNames::SnsBank), - BankNames::TriodosBank => Ok(MultisafepayBankNames::TriodosBank), - BankNames::VanLanschot => Ok(MultisafepayBankNames::VanLanschot), - BankNames::Yoursafe => Ok(MultisafepayBankNames::Yoursafe), - BankNames::Handelsbanken => Ok(MultisafepayBankNames::Handelsbanken), + BankNames::AbnAmro => Ok(Self::AbnAmro), + BankNames::AsnBank => Ok(Self::AsnBank), + BankNames::Bunq => Ok(Self::Bunq), + BankNames::Ing => Ok(Self::Ing), + BankNames::Knab => Ok(Self::Knab), + BankNames::N26 => Ok(Self::N26), + BankNames::NationaleNederlanden => Ok(Self::NationaleNederlanden), + BankNames::Rabobank => Ok(Self::Rabobank), + BankNames::Regiobank => Ok(Self::Regiobank), + BankNames::Revolut => Ok(Self::Revolut), + BankNames::SnsBank => Ok(Self::SnsBank), + BankNames::TriodosBank => Ok(Self::TriodosBank), + BankNames::VanLanschot => Ok(Self::VanLanschot), + BankNames::Yoursafe => Ok(Self::Yoursafe), + BankNames::Handelsbanken => Ok(Self::Handelsbanken), BankNames::AmericanExpress | BankNames::AffinBank | BankNames::AgroBank @@ -379,11 +379,10 @@ impl TryFrom<&BankNames> for MultisafepayBankNames { | BankNames::Starling | BankNames::TsbBank | BankNames::TescoBank - | BankNames::UlsterBank => Err(errors::ConnectorError::NotSupported { + | BankNames::UlsterBank => Err(Into::into(errors::ConnectorError::NotSupported { message: String::from("BankRedirect"), connector: "Multisafepay", - }) - .map_err(Into::into), + })), } } } From ee0b441d8e96f4ea201cf3e0c4ade7fd8bbb6b22 Mon Sep 17 00:00:00 2001 From: taksh Date: Mon, 20 May 2024 09:10:55 +0530 Subject: [PATCH 6/7] Update configs for giropay and ideal --- config/deployments/integration_test.toml | 7 ++++--- config/deployments/production.toml | 5 +++-- config/deployments/sandbox.toml | 5 +++-- config/development.toml | 5 +++-- .../src/connector/multisafepay/transformers.rs | 12 ++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml index 9ee70479d7d..65ec6f0b050 100644 --- a/config/deployments/integration_test.toml +++ b/config/deployments/integration_test.toml @@ -3,11 +3,12 @@ eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_ban eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe" ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" +ideal.multisafepay.banks = "abn_amro, asn_bank, bunq, handelsbanken, nationale_nederlanden, n26, ing, knab, rabobank, regiobank, revolut, sns_bank,triodos_bank, van_lanschot, yoursafe" online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza" online_banking_fpx.adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank" online_banking_poland.adyen.banks = "blik_psp,place_zipko,m_bank,pay_with_ing,santander_przelew24,bank_pekaosa,bank_millennium,pay_with_alior_bank,banki_spoldzielcze,pay_with_inteligo,bnp_paribas_poland,bank_nowy_sa,credit_agricole,pay_with_bos,pay_with_citi_handlowy,pay_with_plus_bank,toyota_bank,velo_bank,e_transfer_pocztowy24" online_banking_slovakia.adyen.banks = "e_platby_vub,postova_banka,sporo_pay,tatra_pay,viamo" -online_banking_thailand.adyen.banks = "bangkok_bank,krungsri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank" +online_banking_thailand.adyen.banks = "bangkok_bank,krungsrgiri_bank,krung_thai_bank,the_siam_commercial_bank,kasikorn_bank" open_banking_uk.adyen.banks = "aib,bank_of_scotland,danske_bank,first_direct,first_trust,halifax,lloyds,monzo,nat_west,nationwide_bank,royal_bank_of_scotland,starling,tsb_bank,tesco_bank,ulster_bank,barclays,hsbc_bank,revolut,santander_przelew24,open_bank_success,open_bank_failure,open_bank_cancelled" przelewy24.stripe.banks = "alior_bank,bank_millennium,bank_nowy_bfg_sa,bank_pekao_sa,banki_spbdzielcze,blik,bnp_paribas,boz,citi,credit_agricole,e_transfer_pocztowy24,getin_bank,idea_bank,inteligo,mbank_mtransfer,nest_przelew,noble_pay,pbac_z_ipko,plus_bank,santander_przelew24,toyota_bank,volkswagen_bank" @@ -123,9 +124,9 @@ pay_later.klarna.connector_list = "adyen" wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" wallet.paypal.connector_list = "adyen" -bank_redirect.ideal.connector_list = "stripe,adyen,globalpay" +bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" -bank_redirect.giropay.connector_list = "adyen,globalpay" +bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" [mandates.update_mandate_supported] diff --git a/config/deployments/production.toml b/config/deployments/production.toml index cdc09d305ef..6d6bdf2eeb5 100644 --- a/config/deployments/production.toml +++ b/config/deployments/production.toml @@ -3,6 +3,7 @@ eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_ban eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe" ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" +ideal.multisafepay.banks = "abn_amro, asn_bank, bunq, handelsbanken, nationale_nederlanden, n26, ing, knab, rabobank, regiobank, revolut, sns_bank,triodos_bank, van_lanschot, yoursafe" online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza" online_banking_fpx.adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank" online_banking_poland.adyen.banks = "blik_psp,place_zipko,m_bank,pay_with_ing,santander_przelew24,bank_pekaosa,bank_millennium,pay_with_alior_bank,banki_spoldzielcze,pay_with_inteligo,bnp_paribas_poland,bank_nowy_sa,credit_agricole,pay_with_bos,pay_with_citi_handlowy,pay_with_plus_bank,toyota_bank,velo_bank,e_transfer_pocztowy24" @@ -122,9 +123,9 @@ pay_later.klarna.connector_list = "adyen" wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" wallet.paypal.connector_list = "adyen" -bank_redirect.ideal.connector_list = "stripe,adyen,globalpay" +bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" -bank_redirect.giropay.connector_list = "adyen,globalpay" +bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" [mandates.update_mandate_supported] card.credit ={connector_list ="cybersource"} diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml index acec5bbadf0..407ed5f78cb 100644 --- a/config/deployments/sandbox.toml +++ b/config/deployments/sandbox.toml @@ -3,6 +3,7 @@ eps.adyen.banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_ban eps.stripe.banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" ideal.adyen.banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot,yoursafe" ideal.stripe.banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" +ideal.multisafepay.banks = "abn_amro, asn_bank, bunq, handelsbanken, nationale_nederlanden, n26, ing, knab, rabobank, regiobank, revolut, sns_bank,triodos_bank, van_lanschot, yoursafe" online_banking_czech_republic.adyen.banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza" online_banking_fpx.adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank" online_banking_poland.adyen.banks = "blik_psp,place_zipko,m_bank,pay_with_ing,santander_przelew24,bank_pekaosa,bank_millennium,pay_with_alior_bank,banki_spoldzielcze,pay_with_inteligo,bnp_paribas_poland,bank_nowy_sa,credit_agricole,pay_with_bos,pay_with_citi_handlowy,pay_with_plus_bank,toyota_bank,velo_bank,e_transfer_pocztowy24" @@ -123,9 +124,9 @@ pay_later.klarna.connector_list = "adyen" wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" wallet.paypal.connector_list = "adyen" -bank_redirect.ideal.connector_list = "stripe,adyen,globalpay" +bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" -bank_redirect.giropay.connector_list = "adyen,globalpay" +bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" [mandates.update_mandate_supported] card.credit = { connector_list = "cybersource" } diff --git a/config/development.toml b/config/development.toml index 4062ae6d9e9..d2e56372a33 100644 --- a/config/development.toml +++ b/config/development.toml @@ -268,6 +268,7 @@ adyen = { banks = "bank_austria,bawag_psk_ag,dolomitenbank,easybank_ag,erste_ban [bank_config.ideal] stripe = { banks = "abn_amro,asn_bank,bunq,handelsbanken,ing,knab,moneyou,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot" } adyen = { banks = "abn_amro,asn_bank,bunq,ing,knab,n26,nationale_nederlanden,rabobank,regiobank,revolut,sns_bank,triodos_bank,van_lanschot, yoursafe" } +multisafepay = { banks="abn_amro, asn_bank, bunq, handelsbanken, nationale_nederlanden, n26, ing, knab, rabobank, regiobank, revolut, sns_bank,triodos_bank, van_lanschot, yoursafe" } [bank_config.online_banking_czech_republic] adyen = { banks = "ceska_sporitelna,komercni_banka,platnosc_online_karta_platnicza" } @@ -512,9 +513,9 @@ card.debit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,global bank_debit.ach = { connector_list = "gocardless" } bank_debit.becs = { connector_list = "gocardless" } bank_debit.sepa = { connector_list = "gocardless" } -bank_redirect.ideal = { connector_list = "stripe,adyen,globalpay" } +bank_redirect.ideal = { connector_list = "stripe,adyen,globalpay,multisafepay" } bank_redirect.sofort = { connector_list = "stripe,adyen,globalpay" } -bank_redirect.giropay = { connector_list = "adyen,globalpay" } +bank_redirect.giropay = { connector_list = "adyen,globalpay,multisafepay" } [mandates.update_mandate_supported] card.credit = { connector_list = "cybersource" } diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index d2af5043ce7..69f40eb7a74 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -758,19 +758,15 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> } domain::PaymentMethodData::BankRedirect(ref bank_redirect_data) => { match bank_redirect_data { - domain::BankRedirectData::Ideal { - billing_details: _, - bank_name, - country: _, - } => Some(GatewayInfo::BankRedirect(BankRedirectInfo::Ideal( - IdealInfo { + domain::BankRedirectData::Ideal { bank_name, .. } => Some( + GatewayInfo::BankRedirect(BankRedirectInfo::Ideal(IdealInfo { issuer_id: MultisafepayBankNames::try_from(&bank_name.ok_or( errors::ConnectorError::MissingRequiredField { field_name: "ideal.bank_name", }, )?)?, - }, - ))), + })), + ), domain::BankRedirectData::BancontactCard { .. } | domain::BankRedirectData::Bizum { .. } | domain::BankRedirectData::Blik { .. } From 6612562c50469eb2519de68f2bc881a272a3d98d Mon Sep 17 00:00:00 2001 From: taksh Date: Fri, 7 Jun 2024 09:21:42 +0530 Subject: [PATCH 7/7] refactor(connector): fix formatting --- crates/router/src/connector/multisafepay/transformers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/router/src/connector/multisafepay/transformers.rs b/crates/router/src/connector/multisafepay/transformers.rs index 8a60307e4dc..49e4c516265 100644 --- a/crates/router/src/connector/multisafepay/transformers.rs +++ b/crates/router/src/connector/multisafepay/transformers.rs @@ -592,7 +592,7 @@ impl TryFrom<&MultisafepayRouterData<&types::PaymentsAuthorizeRouterData>> }), domain::PaymentMethodData::PayLater(domain::PayLaterData::KlarnaRedirect {}) => { Some(Gateway::Klarna) - }, + } domain::PaymentMethodData::MandatePayment => None, domain::PaymentMethodData::CardRedirect(_) | domain::PaymentMethodData::PayLater(_)