feat(router): add connector field to PaymentRevenueRecoveryMetadata and implement schedule_failed_payment (#7462)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Aditya Chaurasia
2025-03-13 14:48:36 +05:30
committed by GitHub
parent 13c621ae62
commit aa337eee9c
18 changed files with 174 additions and 51 deletions

View File

@ -7473,6 +7473,15 @@ pub struct FeatureMetadata {
pub payment_revenue_recovery_metadata: Option<PaymentRevenueRecoveryMetadata>,
}
#[cfg(feature = "v2")]
impl FeatureMetadata {
pub fn get_retry_count(&self) -> Option<u16> {
self.payment_revenue_recovery_metadata
.as_ref()
.map(|metadata| metadata.total_retry_count)
}
}
/// additional data that might be required by hyperswitch
#[cfg(feature = "v1")]
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]
@ -8378,6 +8387,9 @@ pub struct PaymentRevenueRecoveryMetadata {
/// PaymentMethod Subtype
#[schema(example = "klarna", value_type = PaymentMethodType)]
pub payment_method_subtype: common_enums::PaymentMethodType,
/// The name of the payment connector through which the payment attempt was made.
#[schema(value_type = Connector, example = "stripe")]
pub connector: common_enums::connector_enums::Connector,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[cfg(feature = "v2")]