#koidestroyer

1 messages · Page 1 of 1 (latest)

hybrid falconBOT
umbral barn
#

👋 happy to help

#

is this subscription related? nvm

placid cloud
#

I see - and is there an option to make the payment element preload? I get a noticeable delay when loading the page up - my components appear and then the stripe element loads and appears. Can I somehow prevent this

umbral barn
#

this is the approach where the payment element loads first then after collecting the payment info you create the payment intent

hybrid falconBOT
placid cloud
#

Yeah, but when you mount it later it appears after. So basically I need to have 2 separate views, the first to select the amount and a second, later view for the payment element?

knotty patrol
#

If you will be loading the PaymentElement at the moment of updating the quantity/final price, you can use the guide my colleauge shared with you previously

#

Otherwise, you can create the PaymentIntent, mount the Stripe element, and. keep updating it whenever your customer updates the quantity:

placid cloud
#

To see if I get it: The way to show the quantity selector and the payment element in the same view is to update the intent when the quantity changes?

#

Otherwise I get an empty element until I get the quantity setup (so I need to make the customer select the quantity and then push a button to confirm so I can load up the payment element

placid cloud
#

cool

#

and what about the clientSecret? how is it a secret?

#

I mean, anybody could read it via their developer console

knotty patrol
#

It's a client_seceret and not your platform secret

#

which means, it can be shared with the client it self yes (and so they can inspect it and see it via their dev tool)

placid cloud
#

what happens if someone intercepts it?

#

the could pay on their behalf?

knotty patrol
#

Yes