#dalibor8709

1 messages · Page 1 of 1 (latest)

gritty vigilBOT
onyx heron
#

Hi there!

faint prism
#

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

gritty vigilBOT
onyx heron
faint prism
#

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?**
inland stratus
#

Sounds about right, yep

faint prism
#

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

inland stratus
#

Sorry, not understanding the ask. Do you want to use Stripe Tax to automatically calculate and collect tax?

faint prism
#

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

inland stratus
faint prism
#

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."

inland stratus
#

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

#

Then use that hash when creating your Customer object in the backend

faint prism
#

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.

inland stratus
faint prism
#

Thank you very much