Skip to content

Commit ff301f3

Browse files
siaass842Sayak Basak
andauthored
feat: card_redirect_ucs (#10924)
Co-authored-by: Sayak Basak <[email protected]>
1 parent 15f4384 commit ff301f3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

crates/router/src/core/unified_connector_service.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,30 @@ pub fn build_unified_connector_service_payment_method(
653653
payment_method: Some(PaymentMethod::Card(card_details)),
654654
})
655655
}
656+
hyperswitch_domain_models::payment_method_data::PaymentMethodData::CardRedirect(
657+
card_redirect_data,
658+
) => {
659+
let card_redirect_type = match card_redirect_data {
660+
hyperswitch_domain_models::payment_method_data::CardRedirectData::Knet {} => {
661+
payments_grpc::card_redirect::CardRedirectType::Knet
662+
}
663+
hyperswitch_domain_models::payment_method_data::CardRedirectData::Benefit {} => {
664+
payments_grpc::card_redirect::CardRedirectType::Benefit
665+
}
666+
hyperswitch_domain_models::payment_method_data::CardRedirectData::MomoAtm {} => {
667+
payments_grpc::card_redirect::CardRedirectType::MomoAtm
668+
}
669+
hyperswitch_domain_models::payment_method_data::CardRedirectData::CardRedirect {} => {
670+
payments_grpc::card_redirect::CardRedirectType::CardRedirect
671+
}
672+
};
673+
674+
Ok(payments_grpc::PaymentMethod {
675+
payment_method: Some(PaymentMethod::CardRedirect(payments_grpc::CardRedirect {
676+
r#type: card_redirect_type.into(),
677+
})),
678+
})
679+
}
656680
hyperswitch_domain_models::payment_method_data::PaymentMethodData::Upi(upi_data) => {
657681
let upi_type = match upi_data {
658682
hyperswitch_domain_models::payment_method_data::UpiData::UpiCollect(

0 commit comments

Comments
 (0)