From bf1fdf4365c76c58559c906e1c8414ad2303339e Mon Sep 17 00:00:00 2001 From: Remon Date: Mon, 20 Nov 2023 20:55:45 +0000 Subject: [PATCH] revert stripe checkout fix --- .../stripe_checkout/lib/stripe_checkout.dart | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/stripe_checkout/lib/stripe_checkout.dart b/packages/stripe_checkout/lib/stripe_checkout.dart index cb21e9aee..43198bb7f 100644 --- a/packages/stripe_checkout/lib/stripe_checkout.dart +++ b/packages/stripe_checkout/lib/stripe_checkout.dart @@ -1,9 +1,10 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:stripe_checkout/src/platforms/checkout.dart' show CheckoutResponse; -import 'src/platforms/stripe_checkout_web.dart' as stripe; +import 'src/platforms/checkout.dart'; +import 'src/platforms/stripe_checkout.dart' + if (dart.library.js) 'src/platforms/stripe_checkout_web.dart' as stripe; Future redirectToCheckout({ required BuildContext context, @@ -13,17 +14,12 @@ Future redirectToCheckout({ String? successUrl, String? canceledUrl, }) { - if (kIsWeb) { - return stripe.redirectToCheckout( - context: context, - sessionId: sessionId, - publishableKey: publishableKey, - stripeAccountId: stripeAccountId, - successUrl: successUrl, - canceledUrl: canceledUrl, - ); - } else { - throw UnsupportedError( - 'redirectToCheckout is not supported on this platform'); - } + return stripe.redirectToCheckout( + context: context, + sessionId: sessionId, + publishableKey: publishableKey, + stripeAccountId: stripeAccountId, + successUrl: successUrl, + canceledUrl: canceledUrl, + ); }