diff --git a/packages/stripe_ios/ios/Classes/StripePlugin.swift b/packages/stripe_ios/ios/Classes/StripePlugin.swift index b81e1f28d..69fd8a87d 100644 --- a/packages/stripe_ios/ios/Classes/StripePlugin.swift +++ b/packages/stripe_ios/ios/Classes/StripePlugin.swift @@ -176,10 +176,17 @@ extension StripePlugin { func initPaymentSheet(_ call: FlutterMethodCall, result: @escaping FlutterResult) { guard let arguments = call.arguments as? FlutterMap, - let params = arguments["params"] as? NSDictionary else { + var params = arguments["params"] as? NSDictionary else { result(FlutterError.invalidParams) return } + if (params.object(forKey: "intentConfiguration") != nil) { + let mutable = (params["intentConfiguration"] as! NSDictionary).mutableCopy() as! NSMutableDictionary + mutable["confirmHandler"] = true; + let adjusted = params.mutableCopy() as! NSMutableDictionary + adjusted["intentConfiguration"] = mutable + params = adjusted + } initPaymentSheet(params: params, resolver: resolver(for: result), rejecter: rejecter(for: result)) }