mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
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:
@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user