#lil_nasty_
1 messages · Page 1 of 1 (latest)
Yes, if it's part of an Elements group with a payment Element it should work without that.
https://stripe.com/docs/elements/address-element?platform=web#autocomplete
If you use the Address Element and the Payment Element together, Stripe enables autocomplete with no configuration required.
We're having a user pay for a subscription w/ automatic_tax enabled, but in order to do this I need an address (or atleast zipcode) already attached to the customer.
We don't collect these details until they get to the page where they'll be paying, so I can't attach the address to the customer prior to them getting to this page
Will I have to do the following or is there some other way?
- Render address element
- Send address result to server
- Attach address to customer/create customer w/ address
- Create subscription w/ the user who has an address attached
- Render payment element
From what I'm reading this is the way, but wondering if there's some other smoother way.
If not is there some way to get the address element to use the auto-complete w/o using our own key?
You can render the payment element and address element together, then use addressElement.getValue() to get the address to create the customer/subscription
But can I render the payment element w/o a client secret?
You can!
See here:
Actually, hmm, the subscription details are not there like I expected -- let me try to find that
Still looking for docs for you. But, generally speaking, you can follow the pattern there changing to mode=subscription in the config
and you collect payment details first and confirm the payment (for the first invoice) after
hmm this seems problematic for getting the calculated tax rate back from stripe before collecting payment details
I actually worked through that exact flow very recently 🙂
You can collect the address and ayment details, then get your subscription including the calculated tax final amount to show the customer before finally calling confirm
I see, so collect the address, then attach that to the customer, then collect the payment method, then create the subscription, then when we get back the sub's payment details show the price + tax and let the user click confirm to finish, right?
This makes sense, but if possible I'd like to just call the api w/ the address and then make one more call to creat the sub and get all the info then be able to just confrm the payment from there.
The only barrier seems to be the need to have the address element within an element provider that also has a payment element to get the auto-completion. Is it possible to use the auto-completion outside of an element that has the payment element? Or is the only way to do that to use a google maps api key that we own?
That's the only way, when not used with the payment element
Ok, makes sense! Thank you very much for the help