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

fix(connectors): [Stripe] update overcapture handling and add CLF currency to db (#9880)

AkshayaFoiger16ee54ad09e9
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
index e9379a2034..1ae47056d0 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
@@ -2629,8 +2629,16 @@ impl StripeChargeEnum {
match payment_method_details {
StripePaymentMethodDetailsResponse::Card { card } => card
.overcapture
- .as_ref()
- .and_then(|overcapture| overcapture.maximum_amount_capturable),
+ .clone()
+ .filter(|overcapture| {
+ matches!(
+ overcapture.status,
+ Some(StripeOvercaptureStatus::Available)
+ )
+ })
+ .and_then(|overcapture_data| {
+ overcapture_data.maximum_amount_capturable
+ }),
_ => None,
}
} else {
diff --git a/migrations/2025-10-16-121924_add_clf_currency/down.sql b/migrations/2025-10-16-121924_add_clf_currency/down.sql
new file mode 100644
index 0000000000..c7c9cbeb40
--- /dev/null
+++ b/migrations/2025-10-16-121924_add_clf_currency/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+SELECT 1;
\ No newline at end of file
diff --git a/migrations/2025-10-16-121924_add_clf_currency/up.sql b/migrations/2025-10-16-121924_add_clf_currency/up.sql
new file mode 100644
index 0000000000..1b68839433
--- /dev/null
+++ b/migrations/2025-10-16-121924_add_clf_currency/up.sql
@@ -0,0 +1,2 @@
+-- Your SQL goes here
+ALTER TYPE "Currency" ADD VALUE IF NOT EXISTS 'CLF' AFTER 'CHF';