{"id":18764894,"url":"https://github.com/psygo/stripe_dart_lab","last_synced_at":"2025-12-07T13:30:18.713Z","repository":{"id":155613876,"uuid":"324568730","full_name":"psygo/stripe_dart_lab","owner":"psygo","description":"A lab for experimenting with the Stripe API in the context of Dart.","archived":false,"fork":false,"pushed_at":"2021-01-05T17:24:18.000Z","size":125,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T05:43:03.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/psygo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-12-26T14:11:40.000Z","updated_at":"2021-01-05T17:24:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a357ff9d-c32a-4b5e-bf64-27c986d9f0a8","html_url":"https://github.com/psygo/stripe_dart_lab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fstripe_dart_lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fstripe_dart_lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fstripe_dart_lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fstripe_dart_lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psygo","download_url":"https://codeload.github.com/psygo/stripe_dart_lab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239662755,"owners_count":19676438,"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":[],"created_at":"2024-11-07T18:31:57.228Z","updated_at":"2025-12-07T13:30:18.329Z","avatar_url":"https://github.com/psygo.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stripe Dart Lab\n\n\u003e Personally, I feel like the best way of getting acquainted with Stripe is through reading the raw [Stripe API Docs][stripe_api]. You will find all of the data entities there, and how to get them, which is exactly what the SDKs do anyway, albeit in a more friendly fashion \u0026mdash; or is the raw fashion more friendly?\n\nThis is supposed to be a repository for experimenting with the [Stripe API][stripe_hq] in the context of Dart and Flutter.\n\nThere are currently 3 main approaches/packages for using the Stripe API in Dart:\n\n1. Pure REST HTTP requests with JSON.\n    - Uses either the [`dart:io`][dart_io] or the [`http`][http_dart] packages.\n1. The [`stripe_payment`][stripe_payment] package.\n1. The [`Stripe`][stripe_dart] Dart package, by Matias Meno and Martin Flucka.\n    - From their docs: *This implementation is based on the official Stripe Java and NodeJS API wrappers and written as a proper native dart library.*\n1. The [`Stripe SDK`][stripe_sdk_dart] package, by Lars Dahl.\n    - Specifically for Flutter.\n    - Has a bunch of useful widgets.\n\n\u003e **Stripe offers a [checklist][checklist] page where you can see the recommended best practices.**\n\n\n[checklist]: https://stripe.com/docs/development/checklist\n[dart_io]: https://api.dart.dev/stable/2.10.4/dart-io/dart-io-library.html\n[http_dart]: https://pub.dev/packages/http\n[stripe_dart]: https://pub.dev/packages/stripe\n[stripe_hq]: https://github.com/stripe\n[stripe_payment]: https://pub.dev/packages/stripe_payment\n[stripe_sdk_dart]: https://pub.dev/packages/stripe_sdk\n\n---\n\n**Table of Contents**\n\n\u003cdiv id=\"user-content-toc\"\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"#1-pros-and-cons-of-each-approach\"\u003e1. Pros and Cons of Each Approach\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#2-creating-payments-with-stripe\"\u003e2. Creating Payments with Stripe\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#3-setting-up-environment-variables\"\u003e3. Setting Up Environment Variables\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#4-resources\"\u003e4. Resources\u003c/a\u003e \n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#41-courses\"\u003e4.1. Courses\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n\n---\n\n## 1. Pros and Cons of Each Approach\n\n| Approach                                   | Pros                                                              | Cons                             |\n| ------------------------------------------ | ----------------------------------------------------------------- | -------------------------------- |\n| REST/HTTP/JSON                             | Highest amount of flexibility, fewer dependencies                 | Way more work, at least at first |\n| [`Stripe` by Meno and Flucka][stripe_dart] | Very basic and yet comprehensive implementation of the Stripe API | Less flexibility                 |\n| [`Stripe SDK` by Dahl][stripe_sdk_dart]    | Tons of useful functionalities and Flutter widgets                | Probably won't use most of it    |\n\n## 2. Creating Payments with Stripe\n\n1. Create payment method\n    - Via new card or existing card\n1. Create payment intent\n    - Requires amount and currency\n1. Confirm payment\n    - Requires client secret and payment method ID.\n\nUse Dart's `http` package to create `GET`/`POST` requests.\n\n## 3. Setting Up Environment Variables\n\nFor security reasons, using environment variables is much safer than exposing them in the code.\n\n\u003e If you make a mistake and accidentally expose a key in your code, Stripe allows you to roll over your current key and get a new one. Note, however, that hooks will work even after a key is dead.\n\nOn Windows, through opening Command Prompt as an admin, you can set an environment variable with something like:\n\n```cmd\nsetx variable=value\n```\n\nTo check if your environment key was correctly set, use `echo %variable%`.\n\n\u003e If you're using VS Code Integrated Terminals, this all might not work. They don't seem to have the correct or expected access to the system scope in this case. This all doesn't seem to work with PowerShell either.\n\nEnvironment variables on Windows are case-sensitive.\n\nYou can also delete environment variables with an empty assignment\n\n```cmd\nsetx variable=\n```\n\n## 4. Resources\n\n1. [Stripe Developers' YouTube Channel][stripe_developers]\n1. [Tutorials by Muhammad Ahsan Ayaz][tutorial_muhammad]\n    - The [repo][tutorial_muhammad_github]\n1. [Google Pay for Transit | System Architecture][google_pay]\n1. [How to architect Online Payment Processing System for an online store?][how_to_architect_online_payment_medium]\n1. [A Role-based Architecture for Processing Payment Requests][role_based_architecture]\n1. [Stripe API Reference][stripe_api]\n1. [Stripe Quickstart][stripe_quickstart]\n1. [Fireship's Stripe Payments Basics][fireship_basics]\n1. [Fireship's Stripe in 100s][fireship_100]\n1. [Fireship's Stripe Payment Intents Tutorial][fireship_tutorial]\n1. [Pub's Stripe SDK][pub_stripe_sdk]\n1. [Pub's Stripe][pub_stripe]\n    - [The package on Gitlab][stripe_gitlab]\n\n\n[fireship_100]: https://www.youtube.com/watch?v=7edR32QVp_A\n[fireship_basics]: https://www.youtube.com/watch?v=1XKRxeo9414\u0026feature=youtu.be\n[fireship_tutorial]: https://fireship.io/lessons/stripe-payment-intents-tutorial/\n[google_pay]: https://developers.google.com/pay/transit/guides/system-architecture\n[how_to_architect_online_payment_medium]: https://medium.com/get-ally/how-to-architect-online-payment-processing-system-for-an-online-store-6dc84350a39\n[pub_stripe]: https://pub.dev/packages/stripe\n[pub_stripe_sdk]: https://pub.dev/packages/stripe_sdk\n[role_based_architecture]: https://w3c.github.io/webpayments/proposals/architecture/\n[stripe_api]: https://stripe.com/docs/api\n[stripe_developers]: https://www.youtube.com/channel/UCd1HAa7hlN5SCQjgCcGnsxw\n[stripe_gitlab]: https://gitlab.com/exitlive/stripe-dart\n[stripe_quickstart]: https://stripe.com/docs/development/quickstart\n[tutorial_muhammad]: https://youtu.be/C0yptHbL2U8\n[tutorial_muhammad_github]: https://github.com/AhsanAyaz/flutter_stripe_payments\n\n### 4.1. Courses\n\n1. [Stripe in Practice][stripe_in_practice]\n1. [Laravel Payment Processing][laravel_payment_processing]\n\n\n[laravel_payment_processing]: https://www.udemy.com/course/laravel-payment-processing-integrating-the-best-gateways-paypal-stripe/\n[stripe_in_practice]: https://www.udemy.com/course/stripe-course/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsygo%2Fstripe_dart_lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsygo%2Fstripe_dart_lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsygo%2Fstripe_dart_lab/lists"}