mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(webhooks): webhooks effect tracker (#2260)
This commit is contained in:
@ -5,7 +5,7 @@ use utoipa::ToSchema;
|
||||
|
||||
use crate::{disputes, enums as api_enums, payments, refunds};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Copy)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum IncomingWebhookEvent {
|
||||
PaymentIntentFailure,
|
||||
@ -39,6 +39,26 @@ pub enum WebhookFlow {
|
||||
BankTransfer,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
/// This enum tells about the affect a webhook had on an object
|
||||
pub enum WebhookResponseTracker {
|
||||
Payment {
|
||||
payment_id: String,
|
||||
status: common_enums::IntentStatus,
|
||||
},
|
||||
Refund {
|
||||
payment_id: String,
|
||||
refund_id: String,
|
||||
status: common_enums::RefundStatus,
|
||||
},
|
||||
Dispute {
|
||||
dispute_id: String,
|
||||
payment_id: String,
|
||||
status: common_enums::DisputeStatus,
|
||||
},
|
||||
NoEffect,
|
||||
}
|
||||
|
||||
impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||
fn from(evt: IncomingWebhookEvent) -> Self {
|
||||
match evt {
|
||||
|
||||
Reference in New Issue
Block a user