Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor(webhook): add a function to retrieve payment_id (#2447)
Narayan Bhat409913fd7507
diff --git a/crates/api_models/src/webhooks.rs b/crates/api_models/src/webhooks.rsindex 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<String> {+ match self {+ Self::Payment { payment_id, .. }+ | Self::Refund { payment_id, .. }+ | Self::Dispute { payment_id, .. } => Some(payment_id.to_string()),+ Self::NoEffect => None,+ }+ }+}+impl From<IncomingWebhookEvent> for WebhookFlow {fn from(evt: IncomingWebhookEvent) -> Self {match evt {