Skip to content

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

refactor(connector): [Stripe] add support for more incoming woocommerce Stripe disputes webhooks (#2150)

Swangi Kumarie023eb800d17
diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs
index b7cb260cb7..e24ccc5881 100644
--- a/crates/router/src/connector/stripe.rs
+++ b/crates/router/src/connector/stripe.rs
@@ -1869,11 +1869,14 @@ impl api::IncomingWebhook for Stripe {
stripe::WebhookEventType::PaymentIntentRequiresAction => {
api::IncomingWebhookEvent::PaymentActionRequired
}
+ stripe::WebhookEventType::ChargeDisputeFundsWithdrawn => {
+ api::IncomingWebhookEvent::DisputeLost
+ }
+ stripe::WebhookEventType::ChargeDisputeFundsReinstated => {
+ api::IncomingWebhookEvent::DisputeWon
+ }
stripe::WebhookEventType::Unknown
| stripe::WebhookEventType::ChargeCaptured
- | stripe::WebhookEventType::ChargeDisputeCaptured
- | stripe::WebhookEventType::ChargeDisputeFundsReinstated
- | stripe::WebhookEventType::ChargeDisputeFundsWithdrawn
| stripe::WebhookEventType::ChargeExpired
| stripe::WebhookEventType::ChargeFailed
| stripe::WebhookEventType::ChargePending
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index fd49046bf3..d84db563e1 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -3055,8 +3055,6 @@ pub enum WebhookEventType {
PaymentIntentFailed,
#[serde(rename = "payment_intent.succeeded")]
PaymentIntentSucceed,
- #[serde(rename = "charge.dispute.captured")]
- ChargeDisputeCaptured,
#[serde(rename = "charge.dispute.created")]
DisputeCreated,
#[serde(rename = "charge.dispute.closed")]