Aus öffentlichen Paketdaten erstellte Orientierung.
Das stripe_checkout-Paket ermöglicht Entwicklern die Erstellung nahtloser Stripe Checkout-Zahlungsseiten für Android, iOS und Web-Plattformen. Es ist direkt mit der sicheren Zahlungsinfrastruktur von Stripe integriert, sodass Benutzer Transaktionen abschließen können, ohne die App oder den Browser verlassen zu müssen. Für Flutter entwickelt, vereinfacht es die Implementierung von Einmalzahlungen, Abonnements und benutzerdefinierten Checkout-Flows. Das Paket übernimmt die Tokenisierung und sichere Datenübertragung und verringert so die Belastung durch PCI-Konformität. Ideal für Apps, die schnelle, zuverlässige und brandnahe Checkout-Erlebnisse erfordern.
Web- und Mobile-Anwendungen mit Checkout-Anforderungen
Entwickler, die PCI-konforme Lösungen suchen
Hinweise
Benötigt ein Stripe-Konto
Für Web ist eine korrekte Backend-Einrichtung erforderlich
Eingeschränkte Anpassungsmöglichkeiten im Vergleich zum vollständigen Stripe SDK
Abhängig von der Internetverbindung
Kann zusätzliche Behandlung für Rückerstattungen und Webhooks erfordern
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Flutter Stripe
The Stripe Flutter SDK allows you to build delightful payment experiences in your native Android and iOS apps using Flutter. We provide powerful and customizable UI screens and elements that can be used out-of-the-box to collect your users' payment details.
Features
Simplified Security: We make it simple for you to collect sensitive data such as credit card numbers and remain PCI compliant. This means the sensitive data is sent directly to Stripe instead of passing through your server. For more information, see our Integration Security Guide.
Google Pay: The plugin can easily act as payment provider for the Pay plugin that enables you to seamlessly integrate Google Pay or Apple Pay. All you need to do is add your stripe publishable key to the payment profile.
Payment methods: Accepting more payment methods helps your business expand its global reach and improve checkout conversion.
Native UI: We provide native screens and elements to securely collect payment details on Android and iOS.
Pre-built payments UI: Learn how to integrate Payment Sheet, the new pre-built payments UI for mobile apps. This pre-built UI lets you accept cards, Apple Pay, and Google Pay out of the box, and includes support for saving & reusing cards.
Recommended usage
If you're selling digital products or services within your app, (e.g. subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use the app store's in-app purchase APIs. This does not apply to app developers in the USA as they are excluded by new court ruling in 2025. See Apple's and Google's guidelines for more information. For all other scenarios you can use this SDK to process payments via Stripe.
Installation
dart pub add flutter_stripe
Requirements
Android
This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:
Rebuild the app, as the above changes don't update with hot reload
These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets
If you are having troubles to make this package to work on Android, join this discussion to get some support.
iOS
Compatible with apps targeting iOS 13 or above.
To upgrade your iOS deployment target to 13.0, you can either do so in Xcode under your Build Settings, or by modifying IPHONEOS_DEPLOYMENT_TARGET in your project.pbxproj directly.
You will also need to update in your Podfile:
platform :ios, '13.0'
For card scanning add the following to your Info.plist:
<key>NSCameraUsageDescription</key><string>Scan your card to add it automatically</string><key>NSCameraUsageDescription</key><string>To scan cards</string>
Web
Now you can use Stripe with Flutter web! Notice right now it is highly experimental and only a subset of features is implemented. Namely:
Note: Stripe is sunsetting CardField and CardForm in favor of PaymentSheet. We recommend using PaymentSheet for all new integrations. See Stripe's documentation for more details.
We also support the Customer Sheet and the Address sheet mobile elements to collect and manage customer payment methods and addresses.
Financial connections
We also support Financial connections in our latest sdk. Check out the docs to learn more on how to set it up.
Deep linking & coexistence with other deep-link plugins
Redirect-based payment methods (Link, iDEAL, Bancontact, PayPal, etc.) send the user out to a browser and back to your app via a returnURL. On iOS, flutter_stripe registers an app- and scene-delegate and forwards incoming URLs to the Stripe SDK. For URLs that are not a pending Stripe redirect it returns false and does not consume them — it does not block app_links, uni_links, go_router, or any other URL handler.
If a deep-link plugin stops receiving links after adding flutter_stripe, it is almost always one of the following (none of which is flutter_stripe consuming the URL):
app_links version. On apps using UISceneDelegate (the Flutter default since 3.41), use app_links >= 7.0.0, which registers a scene delegate. Older versions only register an app delegate and never receive scene:openURLContexts:.
FlutterDeepLinkingEnabled. If it is true in Info.plist, Flutter's own router may handle the URL. Either set it to false, or forward only your Stripe URLs from your router/deep-link handler (see below) and let everything else flow to your routes.
Scheme/returnURL mismatch. Make sure CFBundleURLSchemes, Stripe.urlScheme, and your PaymentSheet returnURL all use the same scheme.
To complete a Stripe redirect while your app owns deep linking, forward matching URLs to Stripe.instance.handleURLCallback():
// e.g. from your app_links / go_router listenerif (uri.scheme == 'yourappscheme' && uri.host == 'safepay') {
awaitStripe.instance.handleURLCallback(uri.toString());
}
A full example (router-based, deep-link-package-based, and the FlutterDeepLinkingEnabled=false approach) is in example/lib/main.dart. See also Stripe.instance.handleURLCallback in the Dart API.
Stripe initialization
To initialize Stripe in your Flutter app, use the Stripe base class.
Stripe offers publishableKey, stripeAccountId, threeDSecureParams and merchantIdentifier. Only publishableKey is required.
Dart API
The library offers several methods to handle stripe related actions:
The example app offers examples on how to use these methods.
Pay Plugin support
flutter_stripe fully supports the Pay plugin from the Google Pay team. By including a few lines you can integrate Stripe as a payment processor for Google / Apple Pay:
Future<void> onGooglePayResult(paymentResult) async {
final response = awaitfetchPaymentIntentClientSecret();
final clientSecret = response['clientSecret'];
final token = paymentResult['paymentMethodData']['tokenizationData']['token'];
final tokenJson = Map.castFrom(json.decode(token));
final params = PaymentMethodParams.cardFromToken(
token: tokenJson['id'],
);
// Confirm Google pay payment methodawaitStripe.instance.confirmPayment(
clientSecret,
params,
);
}
Run the example app
Navigate to the example folder cd example
Install the dependencies
flutter pub get
Set up env vars for the flutter app and a local backend.