#Debjeet
1 messages · Page 1 of 1 (latest)
Hi, Payment Intent should be created from server-side, not flutter
i am using firebase
how can create on that?
how can I take the amount from the user and that amount the user will pay?
you would want to set up a firebase cloud function that interacts with the STripe server api. you will need to do some backend development!
Yep that will need some backend development
I have videos for flutter android they have used payment intent on client side not in server side.
They may use in client side, but it should be created server-side, unless that's a Terminal integration
I have created a product from stripe dashboard with defualt value is $888.
and I have used firebase cloud functions to store the checkout sessions.
But I want that user can change the $888 value to is desired value.
I have already used User can enter the amount
but on that user can enter the amount on your stripe checkout but I want user can enter the amount in my website then it will redirect to stripe checkout
Ok I see, so what you want it not PaymentIntent, still the Checkout session, but you will need to let your customer enter some amount and use it when you create the Checkout Session in Firebase
Using in-line price
yes, right
this is what till now I have achieved
first I have created a product in stripe then I got the price_id which I saved on my firestore database then from firestore I have getting the price_id .
When you create the Checkout Session, how do you create it via Firebase? Can you paste some code here?
buyStuff(ProductDetials pd) async {
setState(() {
loadingPayment = true;
});
String userUid = FirebaseAuth.instance.currentUser!.uid;
var docRef = await FirebaseFirestore.instance
.collection('users')
.doc(userUid)
.collection('checkout_sessions')
.add({
'price': pd.priceId,
'quantity': pd.quatity,
'mode': 'payment',
'success_url': 'https://success.com',
'cancel_url': 'https://cancel.com'
});
my firebase database
Yes, so instead of the 'price': pd.priceId, can you try line_items ?
Feature request Extension name: firestore-stripe-subscriptions Is your feature request related to a problem? Please describe. Stripe supports Checkout Sessions with inline/custom prices: https://st...
But it's an unrecommended path as thorsten commented there
okay let me check this website
if I change my priceId then it doesnot work.
it is not automatically creating priceId
You need to specify line_items then price_data
okay i am checking