Skip to content

Creating Payment method: Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast #198

Closed
@ericel

Description

@ericel

Describe the bug
I am getting the following error trying to use creae payment method for card:

[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0 MethodChannelStripe.createPaymentMethod
package:stripe_platform_interface/src/method_channel_stripe.dart:61

#1 Stripe.createPaymentMethod
package:flutter_stripe/src/stripe.dart:133

To Reproduce

final billingDetails = BillingDetails(
      email: '[email protected]',
      phone: '+48888000888',
      address: Address(
        city: 'Houston',
        country: 'US',
        line1: '1459  Circle Drive',
        line2: '',
        state: 'Texas',
        postalCode: '77063',
      ),
    ); // mocked data for tests

    // 2. Create payment method
    final paymentMethod =
        await Stripe.instance.createPaymentMethod(PaymentMethodParams.card(
      billingDetails: billingDetails,
    ));
    print(paymentMethod);

Smartphone / tablet

  • Device: [e.g. iPhone X]
  • OS: [e.g. iOS 11]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions