Skip to content

Getting null check exception in shipping address(type 'Null' is not a subtype of type 'String' in type cast). but payment is getting successful. #494

Closed
@ravivr-dev

Description

Describe the bug
payment_intents.g.dart

type 'Null' is not a subtype of type 'String' in type cast

this where we are getting null check exception added image for that.

To Reproduce
Steps to reproduce the behavior:

  1. Googlepay using pay plugin payment is getting success.

  2. Then we are adding google pay token to stripe.
    final token =
    paymentResult['paymentMethodData']['tokenizationData']['token'];
    final tokenJson = Map.castFrom(json.decode(token));
    print(tokenJson);
    print("$token{tokenJson['id']}");
    print("Here the whole data is printing");

    final params = PaymentMethodParams.cardFromToken(
    token: tokenJson['id'],
    );

    //PaymentMethodParams.afterpayClearpay(shippingDetails: ShippingDetails())

    // 3. Confirm Google pay payment method
    await Stripe.instance.confirmPayment(
    clientSecret,
    params,
    );

  3. Here we are getting null check exception …

Expected behavior
payment should be done without any exception.

Smartphone / tablet

  • Device: [Samsung galaxy A52]
  • OS: [ Android 11]
  • Package version: [^2.0.2]
  • Flutter version [ 2.2.8.]

Additional context
Add any other context about the problem here.
image_2021_12_21T10_56_51_943Z

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions