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>
This commit is contained in:
Chethan Rao
2024-05-28 20:03:07 +05:30
committed by GitHub
parent 7ca9c6e813
commit c362fd0532
3 changed files with 16 additions and 1 deletions

View File

@ -1010,6 +1010,9 @@ pub struct BusinessProfileResponse {
// Whether to use the billing details passed when creating the intent as payment method billing // Whether to use the billing details passed when creating the intent as payment method billing
pub use_billing_as_payment_method_billing: Option<bool>, pub use_billing_as_payment_method_billing: Option<bool>,
/// Merchant's config to support extended card info feature
pub extended_card_info_config: Option<ExtendedCardInfoConfig>,
} }
#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]

View File

@ -8,7 +8,7 @@ pub use api_models::admin::{
}; };
use common_utils::ext_traits::{Encode, ValueExt}; use common_utils::ext_traits::{Encode, ValueExt};
use error_stack::ResultExt; use error_stack::ResultExt;
use masking::Secret; use masking::{ExposeInterface, Secret};
use crate::{ use crate::{
core::errors, core::errors,
@ -81,6 +81,10 @@ impl ForeignTryFrom<storage::business_profile::BusinessProfile> for BusinessProf
}) })
.transpose()?, .transpose()?,
use_billing_as_payment_method_billing: item.use_billing_as_payment_method_billing, 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()?,
}) })
} }
} }

View File

@ -6949,6 +6949,14 @@
"use_billing_as_payment_method_billing": { "use_billing_as_payment_method_billing": {
"type": "boolean", "type": "boolean",
"nullable": true "nullable": true
},
"extended_card_info_config": {
"allOf": [
{
"$ref": "#/components/schemas/ExtendedCardInfoConfig"
}
],
"nullable": true
} }
} }
}, },