#dalibor8709
1 messages · Page 1 of 1 (latest)
Hi there!
That's possible with the address element: https://stripe.com/docs/elements/address-element
ok, but how to show the payment element and address element on the same screen at the same time
payment element requires payment id and client secret generated in the create subscription api request
Hum... you have a few options. The main one: use Checkout Session to create the subscription, which will handle everything for you: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
Or you could try our new deferred intent flow, where you first collect the payment method: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=subscription
ok , regarding second link with deferred payments, i understand its the following flow:
- we show the payment and address element inside the same root elements (we are using react)
- user enters card info and billing address all at one form and when data is submitted
- we then first create the subscription through our backend (also customer if we do not have then initially)
- we return to the frontend teh payment client secret and its used in confirmPayment() call to stripe api from frontend
- this frontend to stripe api call should communicate both card details and billing address then** is this correct?**
Sounds about right, yep
also do we need to change the backend call from line 19 from my link to include automatic tax field set to true? when i do this i get an error from stripe api indicating the customer must have tax related stuff set - this is the part that is confusing me
its options on this object here
do i need this then
I was doing some testing prior to my first message, and the generated invoice did not include the tax info in it, but i was not using address element at that time
Sorry, not understanding the ask. Do you want to use Stripe Tax to automatically calculate and collect tax?
yes
we want to use stripe to automatically collect tax and to ahve our customers enter the billing info neccessary for tax to work on the same form where credit card details are filled in
Can you share the ID (req_xxx) of the failing API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_VViB2WOSsSzJ62
the error i receive is "The customer's location isn't recognized. Set a valid customer address in order to automatically calculate tax."
I think what you'll need to do is get the address field values from the Address Element when collecting payment details, and pass them to your backend that creates the Customer object
You can use the getValue function: https://stripe.com/docs/js/elements_object/get_value_address_element
Then use that hash when creating your Customer object in the backend
Do you maybe have some documentation for that? The docs for the address element i have found do not show how to obtain the information customer fills in here.
I just linked it: #1121764658630631464 message
Thank you very much