Skip to content

Commit 9c6f0b7

Browse files
NISHANTH1221Nishanth Challa
andauthored
feat(api): Adds support to change reveue_recovery_retry_algorithm_type using UpdateProfileAPI (V2) (#8858)
Co-authored-by: Nishanth Challa <[email protected]>
1 parent 838de44 commit 9c6f0b7

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

crates/api_models/src/admin.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2999,6 +2999,11 @@ pub struct ProfileUpdate {
29992999
/// It is used in payment processing, fraud detection, and regulatory compliance to determine regional rules and routing behavior.
30003000
#[schema(value_type = Option<MerchantCountryCode>, example = "840")]
30013001
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
3002+
3003+
/// Inidcates the state of revenue recovery algorithm type
3004+
#[schema(value_type = Option<RevenueRecoveryAlgorithmType>, example = "cascading")]
3005+
pub revenue_recovery_retry_algorithm_type:
3006+
Option<common_enums::enums::RevenueRecoveryAlgorithmType>,
30023007
}
30033008

30043009
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]

crates/hyperswitch_domain_models/src/business_profile.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,7 @@ pub struct ProfileGeneralUpdate {
13791379
pub external_vault_connector_details: Option<ExternalVaultConnectorDetails>,
13801380
pub merchant_category_code: Option<api_enums::MerchantCategoryCode>,
13811381
pub merchant_country_code: Option<common_types::payments::MerchantCountryCode>,
1382+
pub revenue_recovery_retry_algorithm_type: Option<common_enums::RevenueRecoveryAlgorithmType>,
13821383
}
13831384

13841385
#[cfg(feature = "v2")]
@@ -1459,6 +1460,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
14591460
external_vault_connector_details,
14601461
merchant_category_code,
14611462
merchant_country_code,
1463+
revenue_recovery_retry_algorithm_type,
14621464
} = *update;
14631465
Self {
14641466
profile_name,
@@ -1505,7 +1507,7 @@ impl From<ProfileUpdate> for ProfileUpdateInternal {
15051507
is_clear_pan_retries_enabled: None,
15061508
is_debit_routing_enabled,
15071509
merchant_business_country,
1508-
revenue_recovery_retry_algorithm_type: None,
1510+
revenue_recovery_retry_algorithm_type,
15091511
revenue_recovery_retry_algorithm_data: None,
15101512
is_iframe_redirection_enabled,
15111513
is_external_vault_enabled,

crates/router/src/core/admin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4081,6 +4081,8 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
40814081
}
40824082
};
40834083

4084+
let revenue_recovery_retry_algorithm_type = self.revenue_recovery_retry_algorithm_type;
4085+
40844086
Ok(domain::ProfileUpdate::Update(Box::new(
40854087
domain::ProfileGeneralUpdate {
40864088
profile_name: self.profile_name,
@@ -4130,6 +4132,7 @@ impl ProfileUpdateBridge for api::ProfileUpdate {
41304132
.map(ForeignInto::foreign_into),
41314133
merchant_category_code: self.merchant_category_code,
41324134
merchant_country_code: self.merchant_country_code,
4135+
revenue_recovery_retry_algorithm_type,
41334136
},
41344137
)))
41354138
}

0 commit comments

Comments
 (0)