Stripe Payment Gateway Integration in Flutter
HTML-код
- Опубликовано: 25 ноя 2024
- In this short video tutorial, we'll guide you through adding Stripe as the payment gateway for your next Flutter app!
I will cover everything from setting up a new project to processing donations. You'll learn how to:
Set up your project (including dependency management)
Integrate Stripe using the flutter_stripe plugin
Design a simple payment interface for donations
Handle payment processing with Stripe's Payment Intents
Display success and failure messages with Snackbars
By the end, you'll have a basic Flutter app that allows users to enter donation amounts, pay securely through Stripe, and receive confirmation messages.
⏳ Timestamps :
00:39 Create a new flutter project
01:03 Add Stripe dependency to your project
07:45 UI Implementation part
18:49 Adding Functionality
25:14 Call the payment intent stripe api
🌐 Important Links
dashboard.stri...
docs.stripe.co...
docs.stripe.co...
docs.page/flut...
👨💻 Source Code :
github.com/Sne...
🎓Join our discord community:
/ discord
😍 Thanks for watching , hope you will find this video useful.
Thanks. Worked for me. If you're implementing this in an existing project with a lot of dependencies then chances are you are going to do the chicken dance with Gradle till you find something that works.
I am going through this now 😂😂😂
What do you mean ?
thank you so much for this video, can you do the tutorial how to save it on firebase with cloud funtion?
Bro don’t stop to make such a high quality video ❤️
Thank you so much, with your help i can do all the installation of needed changes gradle, etc
thanks for your video, i tried from lots of video but this works like charmmmm ;)
Such a great tutorial! Can we get google and Apple Pay integration in Part 2?
Thanks for tutorial. lots of knowledge
great tutorial
thanks brother really helpful
i am facing that kind of issue when i run my flutter project or hot restart the app: Error loading .env file or initializing Stripe: Instance of 'FileNotFoundError'
Make sure that you have done this steps -
1) created the .env file and also added your stripe published and secret key on that
2) and also you have added .env in assets of pubspec.yaml file.
Just verify once and tell
Hi. If I have to implement a monthly or yearly subscription model for my mobile application. Then is it mandatory to use In-App-Purchases ? I mean we cannot use an external payment gateway. How Netflix is redirecting users to its website to avoid 30% fees. Please talk about this.
If you accepting payments within your app then you need to pay 30% for each payment this cant be avoided.
If you ask users to subscribe from your website you don't need to pay 30%.
Remember you cannot redirect the user from your app to website for payment this will violate policy.
In case of Netflix they urge users to subscribe through their website.
@@Snehasis4321 Thank you ! Bdw if possible please make a video on this in future how to implement or ask user to pay from website. I mean a flutter basic app for both mobile and website. Because 30% fee is a concern.
thank you so much for this video.
Thanks brother.👍
can you tell how can we save card info using stripe?????????????
Thank you soo much Sir ❤
Hi thanks for your precious help! I have just a question, why do you use the enableOnBackInvokedCallback ? What is the needs?
enableOnBackInvokedCallback is used for gesture of the back button that we press on the android app to go back or exit the app.
@@Snehasis4321 Ok but if it is set to true the back to the previous route closes the app and it doesn't redirect the user to the previous page. Try the pushNamed() method to see the effect. Furthermore the parameter customerEphemeralKeySecret is not inside the result of the API of the paymentIntent, where do you get this information?
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in C:\Program Files\Android\Android Studio\jre
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
I am getting this error
Make sure that you have Java installed on your system, and the error suggest it searching Java from the android folder not the system, so to fix you need to modify file gradle.properties file
`org.gradle.java.home=C:\Program Files\{your system Java path}` add this in gradle.properties and try again
Worked 🎉
please help me , i've tryed everything , but i keed having the error:
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
i've no idea how to fix, i've already tryed everything
update the java version
i had the same problem and i modified app/build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
thanks to chat gpt 😅
what about the production mode like what would be the changes
if you change it to production mode only your publisher key and secret key will change, and you need to replace them with the test ones, else everything will be the same.
anyone receiving a ':flutter_credit_card' namespace error?
When i click on pay button it goes to browser mode and when comes back it says something went wrong
The error i captured in console is aw_browser_terminator
This should not be happening, it should open and intent within the app, can you tell your Android version so that I can replicate the error?
hey man stripe payment not available inida? i cant signup with india as country dont know why it showing you need invitation
If you have an old verified account then it will work, but for now due to rbi regulations they stopped new account sign up, they will again open after they comply with rbi regulations. You can create test account and key, but cannot deploy it to production. I am also facing the same problem 😔.
@@Snehasis4321 iam not looking for production its for learning purpose even for testing they are not allowing i signed with another country and got the test key
bro here we dont need to implement firebase cloud functions?
No it is not required here
what is your jdk version?
Actually you need to edit this gradle.properties otherwise It will not work.
org.gradle.java.home=C:/Program Files/Java/jdk17 [replace with your path]
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4G
@@Snehasis4321 thanks bro it is running now i was not adding the package on Activity file