Description
Describe the bug
I get next error when try to use Stripe.instance.presentPaymentSheet both in Android and iOS.
The same issue was reproduced both in my project and in sample
E/flutter ( 1124): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(Failed, , null, null)
E/flutter ( 1124): #0 JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:155:7)
E/flutter ( 1124): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter ( 1124):
E/flutter ( 1124): #2 MethodChannelStripe.presentPaymentSheet (package:stripe_platform_interface/src/method_channel_stripe.dart:181:5)
E/flutter ( 1124):
E/flutter ( 1124): #3 Stripe.presentPaymentSheet (package:flutter_stripe/src/stripe.dart:268:5)
E/flutter ( 1124):
E/flutter ( 1124): #4 CampContent.build.. (package:_/ui/detail/checkout_screen.dart:58:11)
E/flutter ( 1124):
To Reproduce
Steps to reproduce the behavior:
- Setup stripe, generate "paymentIntentClientSecret"
- Init Stripe.instance.initPaymentSheet:
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
applePay: true,
googlePay: true,
style: ThemeMode.dark,
testEnv: true,
merchantCountryCode: 'DE',
merchantDisplayName: 'Flutter Stripe Store Demo',
paymentIntentClientSecret: '%paymentIntentClientSecret%',
),
); - Call await Stripe.instance.presentPaymentSheet(
parameters: PresentPaymentSheetParameters(
clientSecret: '%paymentIntentClientSecret%',
confirmPayment: true,
));
Expected behavior
User see correct payment modal sheet
Smartphone / tablet
- Device: iPhone 8+ emulator, pixel 3a emulator
- OS: iOS 14, Android 11
- Package version: 1.0.2
- Flutter version: 2.2.1
Additional context