#r3d_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/1331312245593866240
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! There's no such thing as a "Contacts object", but there is address information on the Customer and Payment Method objects.
So it is attached to a paymentmethod?
You can retrieve a Customer with this API: https://docs.stripe.com/api/customers/retrieve
And you can retrieve a Payment Method using this API: https://docs.stripe.com/api/payment_methods/customer
That's specific to the Address Element on the client side. It's not an object in the API itself, it's only a client-side concept.
Does that mean they are not saved on the server?
Because I'm trying to give the customer the ability to edit his Billing address in his dashboard on my website
If I cannot retrieve or save this billing address on stripe apart from during a payment that's gonna make things really complicated
Let's back up. Are you following a guide or tutorial? Can you link me to it?
I'm just trying to use Elements to collect the billing address of the customer
Using svelte-stripe
We don't really have a guide for this specific use case, but it should be possible by creating an Address Element, having your customer fill it in, then you'd use addressElement.getValue() to get the address info, send it to your server, and from there you'd update the Customer's billing address: https://docs.stripe.com/js/elements_object/get_value_address_element
The elements form does show but no info inside and none gets saved, I just want a way to fetch and save billing addresses
What do you mean by "no info inside"? Are you trying to prefill the Address Element with their existing billing address?
I thought that just using the client_secret the element would already be prefilled with the customer's info
I'll use getValue when submitting and save it on my server and use defaultValues to prefill it on load
No, that won't happen. If you're not taking a payment or saving payment details (like card info) you wouldn't use a client secret for this flow as far as I know.
Yep, was just about to link you to that: https://docs.stripe.com/js/elements_object/create_address_element#address_element_create-options-defaultValues