feat(business_profile): add field in profile for manual retry (#9266)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sakil Mostak
2025-09-08 15:33:47 +05:30
committed by GitHub
parent c3ea9412f3
commit 9c11a6e66f
11 changed files with 56 additions and 0 deletions

View File

@ -28533,6 +28533,11 @@
"description": "Time interval (in hours) for polling the connector to check dispute statuses",
"example": 2,
"nullable": true
},
"is_manual_retry_enabled": {
"type": "boolean",
"description": "Indicates if manual retry for payment is enabled or not",
"nullable": true
}
},
"additionalProperties": false
@ -28858,6 +28863,11 @@
"example": 2,
"nullable": true,
"minimum": 0
},
"is_manual_retry_enabled": {
"type": "boolean",
"description": "Indicates if manual retry for payment is enabled or not",
"nullable": true
}
}
},

View File

@ -2196,6 +2196,9 @@ pub struct ProfileCreate {
/// Time interval (in hours) for polling the connector to check dispute statuses
#[schema(value_type = Option<i32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
/// Indicates if manual retry for payment is enabled or not
pub is_manual_retry_enabled: Option<bool>,
}
#[nutype::nutype(
@ -2538,6 +2541,9 @@ pub struct ProfileResponse {
#[schema(value_type = Option<u32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
/// Indicates if manual retry for payment is enabled or not
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v2")]
@ -2878,6 +2884,9 @@ pub struct ProfileUpdate {
#[schema(value_type = Option<u32>, example = 2)]
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
/// Indicates if manual retry for payment is enabled or not
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v2")]

View File

@ -78,6 +78,7 @@ pub struct Profile {
pub merchant_category_code: Option<common_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -136,6 +137,7 @@ pub struct ProfileNew {
pub merchant_category_code: Option<common_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -194,6 +196,7 @@ pub struct ProfileUpdateInternal {
pub merchant_category_code: Option<common_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -249,6 +252,7 @@ impl ProfileUpdateInternal {
merchant_category_code,
merchant_country_code,
dispute_polling_interval,
is_manual_retry_enabled,
} = self;
Profile {
profile_id: source.profile_id,
@ -335,6 +339,7 @@ impl ProfileUpdateInternal {
merchant_category_code: merchant_category_code.or(source.merchant_category_code),
merchant_country_code: merchant_country_code.or(source.merchant_country_code),
dispute_polling_interval: dispute_polling_interval.or(source.dispute_polling_interval),
is_manual_retry_enabled: is_manual_retry_enabled.or(source.is_manual_retry_enabled),
}
}
}
@ -399,6 +404,7 @@ pub struct Profile {
pub merchant_category_code: Option<common_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
@ -703,6 +709,7 @@ impl ProfileUpdateInternal {
merchant_country_code: merchant_country_code.or(source.merchant_country_code),
dispute_polling_interval: None,
split_txns_enabled: split_txns_enabled.or(source.split_txns_enabled),
is_manual_retry_enabled: None,
}
}
}

View File

@ -253,6 +253,7 @@ diesel::table! {
#[max_length = 32]
merchant_country_code -> Nullable<Varchar>,
dispute_polling_interval -> Nullable<Int4>,
is_manual_retry_enabled -> Nullable<Bool>,
}
}

View File

@ -248,6 +248,7 @@ diesel::table! {
#[max_length = 32]
merchant_country_code -> Nullable<Varchar>,
dispute_polling_interval -> Nullable<Int4>,
is_manual_retry_enabled -> Nullable<Bool>,
#[max_length = 64]
routing_algorithm_id -> Nullable<Varchar>,
order_fulfillment_time -> Nullable<Int8>,

View File

@ -84,6 +84,7 @@ pub struct Profile {
pub merchant_category_code: Option<api_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -140,6 +141,7 @@ pub struct ProfileSetter {
pub merchant_category_code: Option<api_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -203,6 +205,7 @@ impl From<ProfileSetter> for Profile {
merchant_category_code: value.merchant_category_code,
merchant_country_code: value.merchant_country_code,
dispute_polling_interval: value.dispute_polling_interval,
is_manual_retry_enabled: value.is_manual_retry_enabled,
}
}
}
@ -268,6 +271,7 @@ pub struct ProfileGeneralUpdate {
pub merchant_category_code: Option<api_enums::MerchantCategoryCode>,
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
pub dispute_polling_interval: Option<primitive_wrappers::DisputePollingIntervalInHours>,
pub is_manual_retry_enabled: Option<bool>,
}
#[cfg(feature = "v1")]
@ -351,6 +355,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_country_code,
dispute_polling_interval,
always_request_extended_authorization,
is_manual_retry_enabled,
} = *update;
Self {
@ -404,6 +409,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code,
merchant_country_code,
dispute_polling_interval,
is_manual_retry_enabled,
}
}
ProfileUpdate::RoutingAlgorithmUpdate {
@ -460,6 +466,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::DynamicRoutingAlgorithmUpdate {
dynamic_routing_algorithm,
@ -513,6 +520,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::ExtendedCardInfoUpdate {
is_extended_card_info_enabled,
@ -566,6 +574,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::ConnectorAgnosticMitUpdate {
is_connector_agnostic_mit_enabled,
@ -619,6 +628,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::NetworkTokenizationUpdate {
is_network_tokenization_enabled,
@ -672,6 +682,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::CardTestingSecretKeyUpdate {
card_testing_secret_key,
@ -725,6 +736,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
ProfileUpdate::AcquirerConfigMapUpdate {
acquirer_config_map,
@ -778,6 +790,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
merchant_category_code: None,
merchant_country_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
},
}
}
@ -851,6 +864,7 @@ impl super::behaviour::Conversion for Profile {
merchant_category_code: self.merchant_category_code,
merchant_country_code: self.merchant_country_code,
dispute_polling_interval: self.dispute_polling_interval,
is_manual_retry_enabled: self.is_manual_retry_enabled,
})
}
@ -950,6 +964,7 @@ impl super::behaviour::Conversion for Profile {
merchant_category_code: item.merchant_category_code,
merchant_country_code: item.merchant_country_code,
dispute_polling_interval: item.dispute_polling_interval,
is_manual_retry_enabled: item.is_manual_retry_enabled,
})
}
.await
@ -1016,6 +1031,7 @@ impl super::behaviour::Conversion for Profile {
merchant_category_code: self.merchant_category_code,
merchant_country_code: self.merchant_country_code,
dispute_polling_interval: self.dispute_polling_interval,
is_manual_retry_enabled: self.is_manual_retry_enabled,
})
}
}
@ -2101,6 +2117,7 @@ impl super::behaviour::Conversion for Profile {
merchant_country_code: self.merchant_country_code,
dispute_polling_interval: None,
split_txns_enabled: Some(self.split_txns_enabled),
is_manual_retry_enabled: None,
})
}

View File

@ -3476,6 +3476,7 @@ impl ProfileCreateBridge for api::ProfileCreate {
merchant_category_code: self.merchant_category_code,
merchant_country_code: self.merchant_country_code,
dispute_polling_interval: self.dispute_polling_interval,
is_manual_retry_enabled: self.is_manual_retry_enabled,
}))
}
@ -3972,6 +3973,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
merchant_category_code: self.merchant_category_code,
merchant_country_code: self.merchant_country_code,
dispute_polling_interval: self.dispute_polling_interval,
is_manual_retry_enabled: self.is_manual_retry_enabled,
},
)))
}

View File

@ -1289,6 +1289,7 @@ mod tests {
is_pre_network_tokenization_enabled: false,
merchant_category_code: None,
dispute_polling_interval: None,
is_manual_retry_enabled: None,
});
let business_profile = state

View File

@ -233,6 +233,7 @@ impl ForeignTryFrom<domain::Profile> for ProfileResponse {
merchant_category_code: item.merchant_category_code,
merchant_country_code: item.merchant_country_code,
dispute_polling_interval: item.dispute_polling_interval,
is_manual_retry_enabled: item.is_manual_retry_enabled,
})
}
}
@ -490,5 +491,6 @@ pub async fn create_profile_from_merchant_account(
merchant_category_code: request.merchant_category_code,
merchant_country_code: request.merchant_country_code,
dispute_polling_interval: request.dispute_polling_interval,
is_manual_retry_enabled: request.is_manual_retry_enabled,
}))
}

View File

@ -0,0 +1,3 @@
-- This file should undo anything in `up.sql`
ALTER TABLE business_profile
DROP COLUMN is_manual_retry_enabled;

View File

@ -0,0 +1,3 @@
-- Your SQL goes here
ALTER TABLE business_profile
ADD COLUMN IF NOT EXISTS is_manual_retry_enabled BOOLEAN;