'Flutter Stripe paymentsheet is opening webpage (hooks.stripe.com) while processing payments

I am developing a flutter application which uses stripe for payments. I am using https://pub.dev/packages/flutter_stripe for this.

Everything is working fine but whenever I initiate payments I always get a webpage middleware (Screenshots attached). What am I doing wrong?Stripe payment sheet and web middle ware :

Here is my implementation in Flutter

    Future<void> makePayment(String planName, String type) async { 
    Fluttertoast.showToast(msg: "initiating Payments, Please wait.");
   ApiProvider provider = ApiProvider();
    final tokenResponse = await provider
    .getPaymentToken(PlanPayment(planName: planName, type: type));
    if (tokenResponse != null) {`
    var _service = locator<NavigationService>();
    String secret = tokenResponse.clientSecret;

  // make a get call from this url
  Map<String, dynamic> paymentIntentData = Map();
  await payment.Stripe.instance.initPaymentSheet(
      paymentSheetParameters: payment.SetupPaymentSheetParameters(
    merchantCountryCode: 'IN',
    testEnv: true,
    paymentIntentClientSecret: secret,
    googlePay: true,
  ));
  try {
    // await Stripe.instance.handleCardAction(secret);
    await payment.Stripe.instance.presentPaymentSheet().then((value) {});
    await payment.Stripe.instance
        .confirmPaymentSheetPayment()
        .then((value) async {
      // await _service.pushNamed(paymentStatus, args: {'isSuccess': true});
    });
  } catch (e) {
    // await _service.pushNamed(paymentStatus, args: {'isSuccess': false});

    print("Stripe error" + e.toString());
  }

  await provider
      .confirmPayment(tokenResponse.transactionId)
      .then((value) async {
    await _service
        .pushReplacementNamed(paymentStatus, args: {"isSuccess": value});
  });
}

}

`



Solution 1:[1]

Maybe you have a webhook put in your account?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 redInvertedTriangles