#diarra
1 messages · Page 1 of 1 (latest)
I use flutter
Is this call made from the frontend?
yesss
You can't create PaymentIntents from the frontend. Please never use a Stripe Secret Key in your client application. You will need to have a backend server to integrate Stripe.
now how to do this because i have a backend server
What language are you using on the server?
the backend server is azure
on the server I use spring boot java
Another question why do you say I can't create PaymentIntents from the frontend ? because when I used this function FutureOr<void> makePayment() async {
try {
paymentIntent = await createPaymentIntent('100', 'EUR');
//STEP 2: Initialize Payment Sheet
await Stripe.instance
.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret:
paymentIntent!['client_secret'], //Gotten from payment intent
style: ThemeMode.dark,
merchantDisplayName: 'Mon shopper',
// billingDetails: BillingDetails(name: "always")
// billingDetailsCollectionConfiguration:
// BillingDetailsCollectionConfiguration(
// name: CollectionMode.always)
))
.then((value) {});
//STEP 3: Display Payment sheet
displayPaymentSheet();
} catch (err) {
throw Exception(err);
}
} , I looked at my stripe dashboard at the payment level I see the payments made
It's not safe to store your secret key on the customers devices.
Please follow this guide: https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet&lang=java
It's not in Flutter as we don't officially support it, but it will give you the idea how the frontend-backend relationship works
instead of stripe providing me with its preconfigured interface for payment forms, I would like to create my own form and the stripe payment in it
is it possible ???
In mobile payments you can only use Card Element: https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=custom
But you can customise the PaymentSheet to fit your design.
ok so if I understand correctly I can't use my own payment form and use stripe api to make stripe payment
???
If you mean you want to collect the payment details on your own, then yes, you can in theory, but it's strongly advised against, and then your application will need to be PCI-compliant: https://stripe.com/gb/guides/pci-compliance
If you use Stripe-provided form you don't need to worry about it.
You will then need to make sure your application is legally PCI-compliant, which is very difficult.
ok now can you help me to have a Stripe-provided form where we collect the name of card holder
You can use the PaymentSheet: https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet&lang=java
ok ok I will see with the PaymentSheet but I had tested it before my only problem was the flutter language that I use on the front side
my problem was i couldn't see as parameter the billingDetailsCollectionConfiguration of SetupPaymentSheetParameters
There's flutter Stripe package, but it's not officially supported by us, so if you run into any issues you will need to reach out to the developer: https://pub.dev/publishers/flutterstripe.io/packages
Happy to help!