mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
feat(webhooks): implement automatic retries for failed webhook deliveries using scheduler (#3842)
This commit is contained in:
@ -3,7 +3,7 @@ use common_utils::{crypto::SignMessage, ext_traits::Encode};
|
||||
use error_stack::ResultExt;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{core::errors, headers, services::request::Maskable};
|
||||
use crate::{core::errors, headers, services::request::Maskable, types::storage::enums};
|
||||
|
||||
pub trait OutgoingWebhookType:
|
||||
Serialize + From<webhooks::OutgoingWebhook> + Sync + Send + std::fmt::Debug + 'static
|
||||
@ -43,3 +43,19 @@ impl OutgoingWebhookType for webhooks::OutgoingWebhook {
|
||||
header.push((headers::X_WEBHOOK_SIGNATURE.to_string(), signature.into()))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub(crate) enum WebhookDeliveryAttempt {
|
||||
InitialAttempt,
|
||||
AutomaticRetry,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
pub(crate) struct OutgoingWebhookTrackingData {
|
||||
pub(crate) merchant_id: String,
|
||||
pub(crate) business_profile_id: String,
|
||||
pub(crate) event_type: enums::EventType,
|
||||
pub(crate) event_class: enums::EventClass,
|
||||
pub(crate) primary_object_id: String,
|
||||
pub(crate) primary_object_type: enums::EventObjectType,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user