{"id":14969874,"url":"https://github.com/flutter-stripe/flutter_stripe","last_synced_at":"2025-05-14T00:04:53.804Z","repository":{"id":37554013,"uuid":"345929647","full_name":"flutter-stripe/flutter_stripe","owner":"flutter-stripe","description":"Flutter SDK for Stripe.","archived":false,"fork":false,"pushed_at":"2025-05-03T13:40:12.000Z","size":7140,"stargazers_count":1008,"open_issues_count":97,"forks_count":569,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-05-06T20:32:40.660Z","etag":null,"topics":["dart","flutter","stripe"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_stripe","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flutter-stripe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"flutter_stripe"}},"created_at":"2021-03-09T08:08:37.000Z","updated_at":"2025-05-04T07:41:42.000Z","dependencies_parsed_at":"2023-02-17T11:31:30.302Z","dependency_job_id":"551d9055-0082-4f8f-97bc-70f1370ea45f","html_url":"https://github.com/flutter-stripe/flutter_stripe","commit_stats":{"total_commits":462,"total_committers":76,"mean_commits":6.078947368421052,"dds":0.7554112554112554,"last_synced_commit":"d73d6336cc0966a5389c002b025d43c5d8007cac"},"previous_names":[],"tags_count":159,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter-stripe%2Fflutter_stripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter-stripe%2Fflutter_stripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter-stripe%2Fflutter_stripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter-stripe%2Fflutter_stripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flutter-stripe","download_url":"https://codeload.github.com/flutter-stripe/flutter_stripe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253525973,"owners_count":21922196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","stripe"],"created_at":"2024-09-24T13:42:33.767Z","updated_at":"2025-05-14T00:04:53.792Z","avatar_url":"https://github.com/flutter-stripe.png","language":"Dart","funding_links":["https://opencollective.com/flutter_stripe"],"categories":["Flutter Project Showcase"],"sub_categories":[],"readme":"\n\u003cimg src=\"https://user-images.githubusercontent.com/19904063/116995247-20519e80-acda-11eb-8e1b-7d0efbd193ad.png\" height=\"36\" /\u003e\n\n\n# Flutter Stripe\n\n[![pub package](https://img.shields.io/pub/v/flutter_stripe.svg)](https://pub.dev/packages/flutter_stripe) ![build](https://img.shields.io/github/actions/workflow/status/flutter-stripe/flutter_stripe/all_plugins.yaml?logo=github?branch=main)\n\nThe 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.\n\n\n![stripe-flutter_cover](https://user-images.githubusercontent.com/19904063/121511757-48bf6d80-c9e9-11eb-9674-0fec35e26ef5.png)\n\n\n\n## Features\n\n**Simplified Security**: We make it simple for you to collect sensitive data such as credit card numbers and remain [PCI compliant](https://stripe.com/docs/security#pci-dss-guidelines). This means the sensitive data is sent directly to Stripe instead of passing through your server. For more information, see our [Integration Security Guide](https://stripe.com/docs/security).\n\n**Apple Pay**: We provide a [seamless integration with Apple Pay](https://stripe.com/docs/apple-pay).\n\n**Google Pay**: The plugin can easily act as payment provider for the [Pay plugin](#Pay-Plugin-support) 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.\n\n**Payment methods**: Accepting more [payment methods](https://stripe.com/docs/payments/payment-methods/overview) helps your business expand its global reach and improve checkout conversion.\n\n**SCA-Ready**: The SDK automatically performs native [3D Secure authentication](https://stripe.com/docs/payments/3d-secure) if needed to comply with [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) regulation in Europe.\n\n**Native UI**: We provide native screens and elements to securely collect payment details on Android and iOS.\n\n**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 \u0026 reusing cards.\n\n#### Recommended usage\n\nIf 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](https://developer.apple.com/app-store/review/guidelines/#payments) and [Google's](https://support.google.com/googleplay/android-developer/answer/9858738?hl=en\u0026ref_topic=9857752) guidelines for more information. For all other scenarios you can use this SDK to process payments via Stripe.\n\n## Installation\n\n```sh\ndart pub add flutter_stripe\n```\n\n### Requirements\n\n#### Android\n\n\nThis plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:\n\n1. Use Android 5.0 (API level 21) and above.\n2. Use Kotlin version 1.8.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/settings.gradle#L22)\n3. Requires Android Gradle plugin 8 and higher\n4. Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)\n5. Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6) \n6. Using `FlutterFragmentActivity` instead of `FlutterActivity` in `MainActivity.kt`: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/app/src/main/kotlin/com/flutter/stripe/example/MainActivity.kt#L6)\n7. Add the following rules to your `proguard-rules.pro` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/app/proguard-rules.pro)  \n```proguard\n-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivity$g\n-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args\n-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error\n-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter\n-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider\n```\n8. Add the following line to your `gradle.properties` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/gradle.properties)\n```properties\nandroid.enableR8.fullMode=false\n```\nThis will prevent crashes with the Stripe SDK on Android (see [issue](https://github.com/flutter-stripe/flutter_stripe/issues/1909)).\n\n9. Rebuild the app, as the above changes don't update with hot reload\n\nThese 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\n\nIf you are having troubles to make this package to work on Android, join [this discussion](https://github.com/flutter-stripe/flutter_stripe/discussions/538) to get some support.\n\n#### iOS\n\nCompatible with apps targeting iOS 13 or above.\n\nTo 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.\n\nYou will also need to update in your Podfile:\n\n`platform :ios, '13.0'`\n\nFor card scanning add the following to your Info.plist:\n\n```xml\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eScan your card to add it automatically\u003c/string\u003e\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eTo scan cards\u003c/string\u003e\n```\n\n#### Web\n\nNow you can use Stripe with Flutter web! Notice right now it is highly experimental and only a subset of features is implemented. Namely:\n\n- Create paymentmethod\n- Confirm payment intent\n- Confirm setup intent\n- Create token\n\n### Supported widgets\n- [Confirm payment element](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/lib/screens/payment_sheet/payment_element/platforms/payment_element_web.dart) (recommended way of handling payments on web)\n- [Express checkout](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/lib/screens/payment_sheet/express_checkout/platforms/express_checkout_element_web.dart)\n\nTo use Stripe on web, it is required to add `flutter_stripe_web` in your pubspec file\n\n## Usage\n\n### Card payments \n\nThere are 3 ways of handling card payments\n\nMethod        | Ease of use   | description                                                                                                      | Implementation docs |\n------------- | ------------- |----------------------------------------------------------------------------------------------------------------- | ------------------- |\nPayment sheet | Easy          | Our recommended way of handling payments. It offers localization, animations and error handling out of the box.  | [docs](https://docs.page/flutter-stripe/flutter_stripe/sheet) |\nCardfield     | Medium        | Single line cardfield. Offers more flexibility but has less built-in functionality.                              | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field)   |\nCard form     | Medium        | Similar as the cardfield but the entry fields are spread across multi lines                                      | [docs](https://docs.page/flutter-stripe/flutter_stripe/card_field)   |\n\n### Wallets\nThis library fully supports native Apple Pay and [Google pay](https://docs.page/flutter-stripe/flutter_stripe/google_pay) integration.\n\n### Mobile elements [BETA]\nWe also support the customer sheet mobile element. Check out the [docs](https://docs.page/flutter-stripe/flutter_stripe/customer_sheet) to learn more on how to set it up.\n\n### Financial connections\nWe also support Financial connections in our latest sdk. Check out the [docs](https://docs.page/flutter-stripe/flutter_stripe/financial_connections) to learn more on how to set it up.\n\n## Stripe initialization\n\nTo initialize Stripe in your Flutter app, use the `Stripe` base class.\n\n`Stripe` offers `publishableKey`, `stripeAccountId`, `threeDSecureParams` and `merchantIdentifier`. Only `publishableKey` is required.\n\n## Dart API\n\nThe library offers several methods to handle stripe related actions:\n\n```dart\nFuture\u003cPaymentMethod\u003e createPaymentMethod(...);\nFuture\u003cPaymentIntent\u003e handleNextAction(...);\nFuture\u003cPaymentIntent\u003e confirmPayment(...);\nFuture\u003cvoid\u003e configure3dSecure(...);\nFuture\u003cbool\u003e isApplePaySupported();\nFuture\u003cvoid\u003e presentApplePay(...);\nFuture\u003cvoid\u003e confirmApplePayPayment(...);\nFuture\u003cSetupIntent\u003e confirmSetupIntent(...);\nFuture\u003cPaymentIntent\u003e retrievePaymentIntent(...);\nFuture\u003cString\u003e createTokenForCVCUpdate(...);\n\nFuture\u003cvoid\u003e initPaymentSheet(...);\nFuture\u003cvoid\u003e presentPaymentSheet(...);\nFuture\u003cvoid\u003e confirmPaymentSheetPayment()\n```\n\nThe example app offers examples on how to use these methods.\n\n## Pay Plugin support\n\nflutter_stripe fully supports the [Pay plugin](https://pub.dev/packages/pay) from the Google Pay team. By including a few lines you can integrate Stripe as a payment processor for Google / Apple Pay:\n\n```dart\nFuture\u003cvoid\u003e onGooglePayResult(paymentResult) async {\n    final response = await fetchPaymentIntentClientSecret();\n    final clientSecret = response['clientSecret'];\n    final token = paymentResult['paymentMethodData']['tokenizationData']['token'];\n    final tokenJson = Map.castFrom(json.decode(token));\n\n    final params = PaymentMethodParams.cardFromToken(\n      token: tokenJson['id'],\n    );\n    // Confirm Google pay payment method\n    await Stripe.instance.confirmPayment(\n      clientSecret,\n      params,\n    );\n}\n```\n\n## Run the example app\n\n- Navigate to the example folder `cd example`\n- Install the dependencies\n  - `flutter pub get`\n- Set up env vars for the flutter app and a local backend.\n  - [Get your test Stripe API keys](https://stripe.com/docs/keys)\n  - `cp lib/.env.example.dart lib/.env.dart` and set your Stripe publishable key.\n  - `cp server/.env.example server/.env` and set the variable values in your newly created `.env` file.\n- Install the server dependencies in the `server` directory: \n  * `cd server`\n  * `npm install` or `yarn --cwd \"server\"`\n- Start the example\n  - Terminal 1: \n    * Move to the `server` directory: `cd server`\n    * Run npm or yarn: `npm start` or `yarn --cwd \"server\" start`\n  - Terminal 2: \n    * Move to the `lib` directory: `cd lib`\n    * Run flutter: `flutter run`\n\n##### Additional steps for webhook forwarding\n\n- [Install the `stripe-cli`](https://stripe.com/docs/stripe-cli)\n- Run `stripe listen --forward-to localhost:4242/webhook`\n\n## Contributing\n\nYou can help us make this project better, feel free to open an new issue or a pull request.\n\n##### Setup\n\nThis project uses [melos](https://github.com/invertase/melos) to manage all the packages inside this repo.\n\n- Install melos: `dart pub global activate melos`\n- Setup melos in your local folder: `melos bootstrap`\n\n##### Useful commands\n\n- Format `melos run format`\n- Analyze `melos run analyze`\n- Test `melos run unittest`\n- Pub get `melos run get`\n\n##### Publishing\n\n- Use `melos version` and `melos publish` to keep all the repositories in sync\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter-stripe%2Fflutter_stripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflutter-stripe%2Fflutter_stripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter-stripe%2Fflutter_stripe/lists"}