#diarra

1 messages · Page 1 of 1 (latest)

thorny plazaBOT
spiral raft
#

Hi! Let me help you with this.

#

What programming language are you using?

glass stream
#

I use flutter

spiral raft
#

Is this call made from the frontend?

glass stream
#

yesss

spiral raft
#

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.

glass stream
#

now how to do this because i have a backend server

spiral raft
#

What language are you using on the server?

glass stream
#

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

spiral raft
#

It's not safe to store your secret key on the customers devices.

#

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

glass stream
#

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 ???

spiral raft
#

But you can customise the PaymentSheet to fit your design.

glass stream
#

ok so if I understand correctly I can't use my own payment form and use stripe api to make stripe payment

#

???

spiral raft
#

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.

glass stream
#

ohhh pity

#

I will want to use my own payment form instead of Stripe-provided form

spiral raft
#

You will then need to make sure your application is legally PCI-compliant, which is very difficult.

glass stream
#

ok now can you help me to have a Stripe-provided form where we collect the name of card holder

spiral raft
thorny plazaBOT
glass stream
#

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

spiral raft
glass stream
#

ok

#

thank

spiral raft
#

Happy to help!