#skoshkarli
1 messages · Page 1 of 1 (latest)
Hi there. Let me look into this
👋 stepping in as codename_duchess needs to step away
No this isn't possible directly. AddressElement will automatically save the address to your PaymentMethod. If you want it associated to the Customer then you would need to update the Customer object with that info
so you are suggesting to listen to the onChange event and grabbing the address then calling customers.udpate with that?
You could do it that way but really I would just wait until after confirmation to make the update
I'd probably just use a Webhook in this case
how so?
correct, PaymentElement
Then yeah, after you confirm the PaymentIntent you can grab the billing details from the payment_intent.succeeded Webhook event
Let's back up a second
Why do you want the address details to be associated to the Customer in the first place?
we are using Avalara for tax calculations and they want us to set pay_immediately: false, on subscription.create call
so that they can then use the address on the customer
to calculate the tax and update the invoice
prior to it being charged
Ah okay so you want it for tax purposes
correct
And Avalara specifically looks at the Customer's address
correct
Okay then yeah you can't do this post-confirm
they said they cant access the address on the payment card
So in that case you are correct that you would use the on('change',...) event
And update the Customer
is it safe to send customer address over https to my server and then update customer from there?