#Dilz-PI

1 messages · Page 1 of 1 (latest)

fluid wolf
#

Hi! If you are using Payment Elements, then you need a client secret to create the Element in the first place.
So like you said, you first create a PaymentIntent on the backend, and then create the Element on the frontend.

frail sparrow
#

Thanks, that's exactly what I thought. it's a pain as my customer is complaining that the system isn't working as there are a few unfulfilled payment intents, and it doesn't matter how much I explain it to her that that's the way it is, she won't accept it. Is there anyway to automatically cancel a paymentIntent after a set time when the paymentIntent is first created?

#

From looking at the docs, this doesn't seem possible.

bitter prism
#

Hey! Taking over

#

Is there anyway to automatically cancel a paymentIntent after a set time when the paymentIntent is first created?
There's isn't, no

#

Is there a specific requirement to use the Payment Element? The client_secret is only a prerequisite with that Element

frail sparrow
#

I was following the recommended option from Stripe for implementing taking card payments. All I want to be able to do is have a payment form on my simple checkout page which collects payment details from someone and ideally only creates a payment in Stripe when someone submits the form

bitter prism
#

Got it. The Payment Element does require a client_secret upfront, mostly as this is used to determine what Payment Methods are available on it (and to show in the UI)

#

If you're only using card payments, then you can use the old CardElement still which doesn't have that requirement

frail sparrow
#

Ah, ok, so it's still ok to use cardelement? I did quite like the option of having google/apple pay though!

bitter prism
#

Yep, it is! It's just not the default/recommended integration path now we support more localised payment methods

frail sparrow
#

ah, ok, this may be the way to go then as I can't get my client to understand that there will be some incomplete payment intents and it's driving me mad! thanks

bitter prism
#

Yeah so I guess with CardElement you'd create the PI in your form submission

#

And then do confirmation with confirmCardPayment passing the Elements instance and the client_secret

frail sparrow
#

cheers for the info, I'll see how I get on

bitter prism
#

Np!