Skip to content

Commit

Permalink
workaround for missing confirmHandler object on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbark committed Aug 29, 2023
1 parent 2fd9183 commit 63efa7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/stripe_ios/ios/Classes/StripePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 63efa7f

Please sign in to comment.