#Szymon From Poland

1 messages ยท Page 1 of 1 (latest)

steady fjordBOT
wraith orchid
#

Hi there!

#

Adding your other screenshot here:

#

You should only mount the Element after you have received the client secret

sudden cargo
#

so basically, after I created a paymentIntent?

wraith orchid
#

Yes. Without a client secret (that comes form a PaymentIntent) you cannot mount the Element.

sudden cargo
#

okay so it works, but when I try to add useStripe, and useElements, I'm getting that and it's just the circle of doom ๐Ÿ˜… how should I initialise useElements properly?

#

because from my understanding i need useStripe & useElements to properly make a transaction

#

@wraith orchid

wraith orchid
#

Can you try to follow what this guide is doing: https://stripe.com/docs/stripe-js/react

  • One file with just the Element component, and without useStripe or useElements
  • Another file with the PaymentElement, and with useStripe and useElements
sudden cargo
#

yeah ofc

#

okay, got it it was because useStripe & useElements needs to be used inside checkout component

#

thx for help

wraith orchid
#

Happy to help ๐Ÿ™‚

tropic finch
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

sudden cargo
#

hey @tropic finch!
I have a question if it's possible to add email input to payment element as required to all payment methods, e.g. in card

tropic finch
#

that's not possible, you'd have to add it yourself