feat(business_profile): add profile id in affected tables and modify api contract (#1971)

This commit is contained in:
Narayan Bhat
2023-08-23 19:34:37 +05:30
committed by GitHub
parent bca9d5013b
commit fe8d4c2eec
29 changed files with 346 additions and 76 deletions

View File

@ -178,6 +178,11 @@ pub struct MerchantAccountUpdate {
///Will be used to expire client secret after certain amount of time to be supplied in seconds
///(900) for 15 mins
pub intent_fulfillment_time: Option<u32>,
/// The default business profile that must be used for creating merchant accounts and payments
/// To unset this field, pass an empty string
#[schema(max_length = 64)]
pub default_profile: Option<String>,
}
#[derive(Clone, Debug, ToSchema, Serialize)]
@ -263,6 +268,10 @@ pub struct MerchantAccountResponse {
/// A boolean value to indicate if the merchant has recon service is enabled or not, by default value is false
pub is_recon_enabled: bool,
/// The default business profile that must be used for creating merchant accounts and payments
#[schema(max_length = 64)]
pub default_profile: Option<String>,
}
#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]
@ -617,6 +626,9 @@ pub struct MerchantConnectorCreate {
}
}))]
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
/// Identifier for the business profile, if not provided default will be chosen from merchant account
pub profile_id: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
@ -711,6 +723,11 @@ pub struct MerchantConnectorResponse {
}
}))]
pub connector_webhook_details: Option<MerchantConnectorWebhookDetails>,
/// The business profile this connector must be created in
/// default value from merchant account is taken if not passed
#[schema(max_length = 64)]
pub profile_id: Option<String>,
}
/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."
@ -936,7 +953,7 @@ pub enum PayoutStraightThroughAlgorithm {
Single(api_enums::PayoutConnectors),
}
#[derive(Clone, Debug, Deserialize, ToSchema)]
#[derive(Clone, Debug, Deserialize, ToSchema, Default)]
#[serde(deny_unknown_fields)]
pub struct BusinessProfileCreate {
/// A short name to identify the business profile

View File

@ -294,6 +294,10 @@ pub struct PaymentsRequest {
/// additional data that might be required by hyperswitch
pub feature_metadata: Option<FeatureMetadata>,
/// The business profile to use for this payment, if not passed the default business profile
/// associated with the merchant account will be used.
pub profile_id: Option<String>,
}
#[derive(
@ -1898,6 +1902,9 @@ pub struct PaymentsResponse {
/// reference to the payment at connector side
#[schema(value_type = Option<String>, example = "993672945374576J")]
pub reference_id: Option<String>,
/// The business profile that is associated with this payment
pub profile_id: Option<String>,
}
#[derive(Clone, Debug, serde::Deserialize, ToSchema)]