Skip to content

Commit

Permalink
revert stripe checkout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Remon committed Nov 20, 2023
1 parent d074ca2 commit bf1fdf4
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions packages/stripe_checkout/lib/stripe_checkout.dart
Original file line number Diff line number Diff line change
@@ -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<CheckoutResponse> redirectToCheckout({
required BuildContext context,
Expand All @@ -13,17 +14,12 @@ Future<CheckoutResponse> 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,
);
}

0 comments on commit bf1fdf4

Please sign in to comment.