#wojtekpanek_code

1 messages ¡ Page 1 of 1 (latest)

burnt prismBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1412394393167462410

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

past violet
#

hi there!

#

can you share more details about your setup? you want to use the Address Element without the Payment Element?

#

or you want to use Addresse Element and Payment Element, but the amount of the payment is $0 (maning you don't charge the user now, but want to save their card for later)?

kindred latch
#

ATM, we have PaymentElements + Link set up but we would like to use your Address Element as well (we have our custom address fields atm). Promo code which I mentioned above can be added at any point of Checkout so I'd like to avoid situation when data inputed by user is lost. Your first assumption is correct - I'd like to hide Payment Element but keep address element

past violet
#

you can use the Address Element by itself. So you could just unmount the Payment Element when needed and keep the Address Element.

kindred latch
#

would it let me set amount to 0? or I just ignore it?

#

in Elements instance

past violet
#

I'm not sure, you'll need to test this. you may need to remove amount: 0 entirely.

kindred latch
#

ok, makes sense, I'll try it out

#

what about second question in the topic? I'm trying to incorporate our custom validation in address element validation and it seams not that straight forward and hacky

past violet
kindred latch
#

yup, that I get, but inputs get .Error class based on only your internal validation and I'd like to style it the same way when there is also an error on our end and it's not that simple since it's in iframe

past violet
#

got it! but no you can't directly change the validation logic that way or trigger an error state on the Address Element.