Skip to content

Commit

Permalink
refactor: retrieve extended card info config during business profile …
Browse files Browse the repository at this point in the history
…get call (#4784)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
Chethan-rao and hyperswitch-bot[bot] authored May 28, 2024
1 parent 7ca9c6e commit c362fd0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 5 additions & 1 deletion crates/router/src/types/api/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()?,
})
}
}
Expand Down
8 changes: 8 additions & 0 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down

0 comments on commit c362fd0

Please sign in to comment.