#Debjeet

1 messages · Page 1 of 1 (latest)

green cloudBOT
warm citrus
#

Hi, Payment Intent should be created from server-side, not flutter

valid briar
#

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?

lapis night
#

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!

warm citrus
#

Yep that will need some backend development

valid briar
#

I have videos for flutter android they have used payment intent on client side not in server side.

warm citrus
#

They may use in client side, but it should be created server-side, unless that's a Terminal integration

valid briar
#

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

warm citrus
#

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

valid briar
warm citrus
#

When you create the Checkout Session, how do you create it via Firebase? Can you paste some code here?

valid briar
#

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'
});

valid briar
warm citrus
#

Yes, so instead of the 'price': pd.priceId, can you try line_items ?

#

But it's an unrecommended path as thorsten commented there

valid briar
#

okay let me check this website

#

if I change my priceId then it doesnot work.

#

it is not automatically creating priceId

warm citrus
#

You need to specify line_items then price_data

valid briar
#

okay i am checking