#jm - elements & zip
1 messages · Page 1 of 1 (latest)
The Element, the one who configures itself using an intent
The Payment Element I think you mean, gotcha
Yes, that one
I want to use Stripe Tax service, but my inputs are created using Payment Element, I don't know how to get the zip value only in order to send it to the Tax service
In which case no that's not currently available using that integration -- we're working on supporting more use cases here though
This is currently only available with the card element in the change event:
https://stripe.com/docs/js/element/events/on_change?type=cardElement#element_on_change-handler-value
Ok but any way to get the zip value alone?
What do you mean?
The only way to get the zip from the card element is via that change event
Hello! If you want to use Stripe Tax you shouldn't need to worry about getting the postal code yourself. Can you describe specifically what you're trying to do with the postal code?
I am trying to send it to the tax service in order to know the tax amount
So you're not using Stripe Tax?
For something like
curl -X GET https://api.stripe.com/v1/invoices/upcoming \
-u sk_test_5KS7eKOIkyAPMV23u9x5sxFt7g1pZTFh00kjzlR1Ns: \
-d "customer_details[address][country]"="US" \
-d "customer_details[address][postal_code]"="77084" \
-d "subscription_items[0][price]"="price_1nmTd242Imk" \
-d "subscription_items[0][quantity]="1 \
-d "automatic_tax[enabled]"=true
Hi there! Stepping in for @unkempt flame as they need to step away. Give me a moment to catch up.
So let's back up and make sure we are on the same page. You want to access the Zip code in order to provide it to a third party so they can calculate tax on your payments?
Correct
Okay and then you are hitting the upcoming invoice endpoint to calculate Tax?
Either way, what was noted above is the way to access the Postal code... you would listen for the change event.
Otherwise, you need to collect it yourself
And turn collection off from Payment Element
Got it
I will try with the change event because if I collect it myself I am afraid I will lose validation
👍
Does the blur event returns all the inputs from the Payment Element?
Nope
Just allows for a callback
However, you can use the complete bool from the change event to know that the Payment Element has been fully filled: https://stripe.com/docs/js/element/events/on_change?type=paymentElement#element_on_change-handler-complete