diff --git a/crates/api_models/src/webhooks.rs b/crates/api_models/src/webhooks.rs index a1cafee1f8..252e3110d6 100644 --- a/crates/api_models/src/webhooks.rs +++ b/crates/api_models/src/webhooks.rs @@ -59,6 +59,17 @@ pub enum WebhookResponseTracker { NoEffect, } +impl WebhookResponseTracker { + pub fn get_payment_id(&self) -> Option { + match self { + Self::Payment { payment_id, .. } + | Self::Refund { payment_id, .. } + | Self::Dispute { payment_id, .. } => Some(payment_id.to_string()), + Self::NoEffect => None, + } + } +} + impl From for WebhookFlow { fn from(evt: IncomingWebhookEvent) -> Self { match evt {