From c362fd05325743bb3d173e335124734f1c23b9fa Mon Sep 17 00:00:00 2001 From: Chethan Rao <70657455+Chethan-rao@users.noreply.github.com> Date: Tue, 28 May 2024 20:03:07 +0530 Subject: [PATCH] refactor: retrieve extended card info config during business profile get call (#4784) Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> --- crates/api_models/src/admin.rs | 3 +++ crates/router/src/types/api/admin.rs | 6 +++++- openapi/openapi_spec.json | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs index 12d9832ada67..dc64947bf08c 100644 --- a/crates/api_models/src/admin.rs +++ b/crates/api_models/src/admin.rs @@ -1010,6 +1010,9 @@ pub struct BusinessProfileResponse { // Whether to use the billing details passed when creating the intent as payment method billing pub use_billing_as_payment_method_billing: Option, + + /// Merchant's config to support extended card info feature + pub extended_card_info_config: Option, } #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs index 8fc3ebb721f2..20083afb1c94 100644 --- a/crates/router/src/types/api/admin.rs +++ b/crates/router/src/types/api/admin.rs @@ -8,7 +8,7 @@ pub use api_models::admin::{ }; use common_utils::ext_traits::{Encode, ValueExt}; use error_stack::ResultExt; -use masking::Secret; +use masking::{ExposeInterface, Secret}; use crate::{ core::errors, @@ -81,6 +81,10 @@ impl ForeignTryFrom for BusinessProf }) .transpose()?, use_billing_as_payment_method_billing: item.use_billing_as_payment_method_billing, + extended_card_info_config: item + .extended_card_info_config + .map(|config| config.expose().parse_value("ExtendedCardInfoConfig")) + .transpose()?, }) } } diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 544908a4f474..4ee0e58c77a8 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -6949,6 +6949,14 @@ "use_billing_as_payment_method_billing": { "type": "boolean", "nullable": true + }, + "extended_card_info_config": { + "allOf": [ + { + "$ref": "#/components/schemas/ExtendedCardInfoConfig" + } + ], + "nullable": true } } },