flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

Strange error in deferred PaymentSheet in iOS

Open pgiacomo69 opened this issue 7 months ago • 0 comments

In iOS the Credit Card Payment (deferred PaymentSheet) is unsuccesful, with a message: "An error occurred in PaymentSheet. Your PaymentIntent setupFutureUsage (none) does not match the PaymentSheet.IntentConfiguration setupFutureUsage (Optional (StripePaymentSheet.PaymentSheet.IntentConfi guration.SetupFutureUsage.onSession))."

Aoole Pay works well. Same App in Android Emulator works perfectly.

Steps to reproduce the behavior:

  1. Entering number 4242 4242 4242 4242 into the cardfield.
  2. Tapping the confirm button.
  3. Observe the failure.

Smartphone / tablet**

  • Device: IPhone 15 Pro Emulator
  • OS: iOS 17
  • Package version: >=10.1
  • Flutter version 3.22

Additional context Add any other context about the problem here.

`await Stripe.instance.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters( merchantDisplayName: 'Flutter Stripe Store Demo', allowsDelayedPaymentMethods: true, intentConfiguration: IntentConfiguration(

          mode: IntentMode(
            setupFutureUsage: null,
            currencyCode: 'eur',
            amount: amount,
          ),

          confirmHandler: (method, saveFuture) {
            _createIntentAndConfirmToUser(method);
          }),

      // Extra params
      primaryButtonLabel: 'Pay now',
      applePay: const PaymentSheetApplePay(
        merchantCountryCode: 'DE',
      ),
      googlePay: const PaymentSheetGooglePay(
        merchantCountryCode: 'DE',
        testEnv: true,
      ),

      style: ThemeMode.light,
      appearance: const PaymentSheetAppearance(
        colors: PaymentSheetAppearanceColors(
            /*  background: Colors.white,
          componentBackground: Colors.white,
          componentText: Colors.black,
          primary: Colors.blue,
          componentBorder: Colors.black,
          placeholderText: Colors.black,
          primaryText: Colors.black,
          secondaryText: Colors.green, */

            ),
        shapes: PaymentSheetShape(
          borderWidth: 0.5,
          borderRadius: 8,
          shadow: PaymentSheetShadowParams(color: Colors.yellow),
        ),
        primaryButton: PaymentSheetPrimaryButtonAppearance(
          shapes: PaymentSheetPrimaryButtonShape(blurRadius: 8),
          colors: PaymentSheetPrimaryButtonTheme(
            light: PaymentSheetPrimaryButtonThemeColors(
              background: Color.fromARGB(255, 231, 235, 30),
              text: Color.fromARGB(255, 235, 92, 30),
              border: Color.fromARGB(255, 235, 92, 30),
            ),
          ),
        ),
      ),
      billingDetails: billingDetails,
    ),
  );`

pgiacomo69 avatar Jul 05 '24 09:07 pgiacomo69