#jm - elements & zip

1 messages · Page 1 of 1 (latest)

coral maple
#

Which element?

astral marlin
#

The Element, the one who configures itself using an intent

coral maple
#

The Payment Element I think you mean, gotcha

astral marlin
#

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

coral maple
#

In which case no that's not currently available using that integration -- we're working on supporting more use cases here though

astral marlin
#

Ok but any way to get the zip value alone?

coral maple
#

What do you mean?

#

The only way to get the zip from the card element is via that change event

unkempt flame
#

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?

astral marlin
#

I am trying to send it to the tax service in order to know the tax amount

unkempt flame
#

So you're not using Stripe Tax?

astral marlin
#

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
grim geyser
#

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?

astral marlin
#

Correct

grim geyser
#

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

astral marlin
#

Got it

#

I will try with the change event because if I collect it myself I am afraid I will lose validation

grim geyser
#

👍

astral marlin
#

Does the blur event returns all the inputs from the Payment Element?

grim geyser
#

Nope

#

Just allows for a callback

astral marlin
#

Awesome, I will try that one

#

Thank you!