#skoshkarli

1 messages · Page 1 of 1 (latest)

old laurelBOT
twilit canopy
#

Hi there. Let me look into this

molten compass
#

👋 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

untold relic
#

so you are suggesting to listen to the onChange event and grabbing the address then calling customers.udpate with that?

molten compass
#

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

untold relic
#

how so?

molten compass
#

Are you using Payment Element?

#

What are you using alongside AddressElement?

untold relic
#

correct, PaymentElement

molten compass
#

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?

untold relic
#

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

molten compass
#

Ah okay so you want it for tax purposes

untold relic
#

correct

molten compass
#

And Avalara specifically looks at the Customer's address

untold relic
#

correct

molten compass
#

Okay then yeah you can't do this post-confirm

untold relic
#

they said they cant access the address on the payment card

molten compass
#

So in that case you are correct that you would use the on('change',...) event

#

And update the Customer

untold relic
#

is it safe to send customer address over https to my server and then update customer from there?

molten compass
#

Yep that would be the recommended route

#

You can't update client-side here

untold relic
#

ok perfect

#

thank you!