#wojtekpanek_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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)?
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
you can use the Address Element by itself. So you could just unmount the Payment Element when needed and keep the Address Element.
I'm not sure, you'll need to test this. you may need to remove amount: 0 entirely.
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
you could listen for the change event or getValue(), to run rextra logic on your end. this is explained here: https://docs.stripe.com/elements/address-element/collect-addresses#web-retrieve-address
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
got it! but no you can't directly change the validation logic that way or trigger an error state on the Address Element.