Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(core): Added Missing Payment Method Type in HS <> UCS Integration (#11365)

Shubhodip palbaf11d6e78ec
diff --git a/crates/router/src/core/unified_connector_service.rs b/crates/router/src/core/unified_connector_service.rs
index e078f4223a..61bb801cb3 100644
--- a/crates/router/src/core/unified_connector_service.rs
+++ b/crates/router/src/core/unified_connector_service.rs
@@ -939,6 +939,82 @@ pub fn build_unified_connector_service_payment_method(
payment_method: Some(PaymentMethod::Interac(interac)),
})
}
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::Bizum { } => {
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Bizum(payments_grpc::Bizum{})),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::LocalBankRedirect { } => {
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::LocalBankRedirect(payments_grpc::LocalBankRedirect{})),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::OnlineBankingCzechRepublic {
+ issuer
+ } => {
+ let online_banking_czech_republic = payments_grpc::OnlineBankingCzechRepublic {
+ issuer: payments_grpc::BankNames::foreign_try_from(issuer)?.into(),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::OnlineBankingCzechRepublic(online_banking_czech_republic)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::OnlineBankingFinland {
+ email
+ } => {
+ let online_banking_finland = payments_grpc::OnlineBankingFinland {
+ email: email.map(|e| e.expose().expose().into()),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::OnlineBankingFinland(online_banking_finland)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::OnlineBankingPoland {
+ issuer
+ } => {
+ let online_banking_poland = payments_grpc::OnlineBankingPoland {
+ issuer: payments_grpc::BankNames::foreign_try_from(issuer)?.into(),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::OnlineBankingPoland(online_banking_poland)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::OnlineBankingSlovakia {
+ issuer
+ } => {
+ let online_banking_slovakia = payments_grpc::OnlineBankingSlovakia {
+ issuer: payments_grpc::BankNames::foreign_try_from(issuer)?.into(),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::OnlineBankingSlovakia(online_banking_slovakia)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::OnlineBankingThailand {
+ issuer
+ } => {
+ let online_banking_thailand = payments_grpc::OnlineBankingThailand {
+ issuer: payments_grpc::BankNames::foreign_try_from(issuer)?.into(),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::OnlineBankingThailand(online_banking_thailand)),
+ })
+ }
+ hyperswitch_domain_models::payment_method_data::BankRedirectData::Eft {
+ provider
+ } => {
+ let eft = payments_grpc::Eft {
+ provider,
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Eft(eft)),
+ })
+ }
hyperswitch_domain_models::payment_method_data::BankRedirectData::BancontactCard {
card_number,
card_exp_month,
@@ -970,10 +1046,6 @@ pub fn build_unified_connector_service_payment_method(
payment_method: Some(PaymentMethod::OnlineBankingFpx(online_banking_fpx)),
})
}
- _ => Err(UnifiedConnectorServiceError::NotImplemented(format!(
- "Unimplemented payment method subtype: {payment_method_type:?}"
- ))
- .into()),
},
hyperswitch_domain_models::payment_method_data::PaymentMethodData::RealTimePayment(
bank_transfer_data,
@@ -1080,6 +1152,22 @@ pub fn build_unified_connector_service_payment_method(
)),
})
}
+ hyperswitch_domain_models::payment_method_data::BankTransferData::LocalBankTransfer {bank_code} =>
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::LocalBankTransfer(payments_grpc::LocalBankTransfer {
+ bank_code,
+ })),
+ }),
+ hyperswitch_domain_models::payment_method_data::BankTransferData::IndonesianBankTransfer {bank_name} =>
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::IndonesianBankTransfer(payments_grpc::IndonesianBankTransfer {
+ bank_name: bank_name.map(payments_grpc::BankNames::foreign_try_from).transpose()?.map(|b| b.into()),
+ })),
+ }),
+ hyperswitch_domain_models::payment_method_data::BankTransferData::Pse {} =>
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::Pse(payments_grpc::Pse {})),
+ }),
hyperswitch_domain_models::payment_method_data::BankTransferData::InstantBankTransfer {} =>
Ok(payments_grpc::PaymentMethod {
payment_method: Some(PaymentMethod::InstantBankTransfer(payments_grpc::InstantBankTransfer {})),
@@ -1092,10 +1180,6 @@ pub fn build_unified_connector_service_payment_method(
Ok(payments_grpc::PaymentMethod {
payment_method: Some(PaymentMethod::InstantBankTransferPoland(payments_grpc::InstantBankTransferPoland {})),
}),
- _ => Err(UnifiedConnectorServiceError::NotImplemented(format!(
- "Unimplemented payment method subtype: {payment_method_type:?}"
- ))
- .into()),
},
hyperswitch_domain_models::payment_method_data::PaymentMethodData::PayLater(
pay_later_data,
@@ -1405,10 +1489,20 @@ pub fn build_unified_connector_service_payment_method(
payment_method: Some(PaymentMethod::Bacs(bacs)),
})
}
- _ => Err(UnifiedConnectorServiceError::NotImplemented(
- "Unimplemented bank debit variant".to_string(),
- )
- .into()),
+ hyperswitch_domain_models::payment_method_data::BankDebitData::SepaGuarenteedBankDebit {
+ iban,
+ bank_account_holder_name,
+ } => {
+ let sepa_guaranteed_debit = payments_grpc::SepaGuaranteedDebit {
+ iban: Some(iban.expose().into()),
+ bank_account_holder_name: bank_account_holder_name
+ .map(|name| name.expose().into()),
+ };
+
+ Ok(payments_grpc::PaymentMethod {
+ payment_method: Some(PaymentMethod::SepaGuaranteedDebit(sepa_guaranteed_debit)),
+ })
+ }
},
_ => Err(UnifiedConnectorServiceError::NotImplemented(format!(
"Unimplemented payment method: {payment_method_data:?}"