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

refactor: retrieve extended card info config during business profile get call (#4784)

Chethan Raoc362fd053257
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 12d9832ada..dc64947bf0 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<bool>,
+
+ /// Merchant's config to support extended card info feature
+ pub extended_card_info_config: Option<ExtendedCardInfoConfig>,
}
#[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 8fc3ebb721..20083afb1c 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<storage::business_profile::BusinessProfile> 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 544908a4f4..4ee0e58c77 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
}
}
},