flutter_stripe
flutter_stripe copied to clipboard
Strange error in deferred PaymentSheet in iOS
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:
- Entering number 4242 4242 4242 4242 into the cardfield.
- Tapping the confirm button.
- 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,
),
);`