From 38abb922d4a9ebfc3a041b0ca925c488588826e9 Mon Sep 17 00:00:00 2001 From: Giacomo Policicchio Date: Mon, 8 Jul 2024 13:12:14 +0200 Subject: [PATCH] Fixes #1834 --- .../ios/Classes/Stripe Sdk/StripeSdk+PaymentSheet.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/stripe_ios/ios/Classes/Stripe Sdk/StripeSdk+PaymentSheet.swift b/packages/stripe_ios/ios/Classes/Stripe Sdk/StripeSdk+PaymentSheet.swift index 497b330f..0d7219e4 100644 --- a/packages/stripe_ios/ios/Classes/Stripe Sdk/StripeSdk+PaymentSheet.swift +++ b/packages/stripe_ios/ios/Classes/Stripe Sdk/StripeSdk+PaymentSheet.swift @@ -224,9 +224,11 @@ extension StripeSdk { mode = PaymentSheet.IntentConfiguration.Mode.payment( amount: amount, currency: modeParams["currencyCode"] as? String ?? "", - setupFutureUsage: modeParams["setupFutureUsage"] != nil - ? (modeParams["setupFutureUsage"] as? String == "OffSession" ? .offSession : .onSession) - : nil, + setupFutureUsage: { return switch modeParams["setupFutureUsage"] as? String { + case "OffSession": .offSession + case "OnSession": .onSession + default: nil + } }(), captureMethod: captureMethod ) } else {