Describe the bug
When getting error from stripe, StripeError.fromJson( returns an error
type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast
the code i use is this
Future<void> confirmCustomerSheet() async {
try {
// 3. display the customer sheet.
final result = await Stripe.instance.presentCustomerSheet();
[...]
strangely on the debugger the field seems to be a map
but the code still except with this message:
[log] type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast
[log] _TypeError (type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast)
[log] #0 _$$StripeErrorGenericImplFromJson (package:stripe_platform_interface/src/models/errors.g.dart:13:40)
#1 new _$StripeErrorGenericImpl.fromJson (package:stripe_platform_interface/src/models/errors.freezed.dart:123:7)
#2 _$StripeErrorFromJson (package:stripe_platform_interface/src/models/errors.freezed.dart:18:10)
#3 new StripeError.fromJson (package:stripe_platform_interface/src/models/errors.dart:26:7)
#4 _$$CustomerSheetResultImplFromJson (package:stripe_platform_interface/src/models/customer_sheet.g.dart:135:13)
#5 new _$CustomerSheetResultImpl.fromJson (package:stripe_platform_interface/src/models/customer_sheet.freezed.dart:1060:7)
#6 _$CustomerSheetResultFromJson (package:stripe_platform_interface/src/models/customer_sheet.freezed.dart:891:31)
#7 new CustomerSheetResult.fromJson (package:stripe_platform_interface/src/models/customer_sheet.dart:105:7)
#8 MethodChannelStripe._parseCustomerSheetResult (package:stripe_platform_interface/src/method_channel_stripe.dart:358:36)
#9 MethodChannelStripe.presentCustomerSheet (package:stripe_platform_interface/src/method_channel_stripe.dart:278:12)
<asynchronous suspension>
#10 _CustomerSheetScreenState.confirmCustomerSheet (package:charge_app/pages/payment_page.dart:132:22)
<asynchronous suspension>
#11 _LoadingButtonState._loadFuture (package:charge_app/loading_button.dart:50:7)
<asynchronous suspension>
To Reproduce
Steps to reproduce the behavior:
Create customer sheet
Create payment method
close
open customer sheet
click on the X button.
the error field fails to be converted to map
Expected behavior
should not except
this seems to be because error field needs to be decoded before?
Describe the bug When getting error from stripe, StripeError.fromJson( returns an error
type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast
the code i use is this
in this code
strangely on the debugger the field seems to be a map but the code still except with this message:
To Reproduce Steps to reproduce the behavior:
Expected behavior should not except
this seems to be because error field needs to be decoded before?