#lean dank - VAT validation

1 messages · Page 1 of 1 (latest)

arctic cedar
#

Good question. Not immediately sure. And to be clear you are working with Stripe.js + Stripe Tax and are looking to validate VATs with some Stripe Tax function?

keen inlet
#

Well right now all im doing is collecting a bunch of data in a form and then sanitizing it before using the Stripe PHP lib to create a new customer. In there I use

'tax_id_data' => [
    [
      'type' => 'us_ein',
      'value' => '<user supplied data>'
    ]
]

to set the tax id for the new customer. Naturally I get thrown an exception when the user supplied data has the wrong pattern.

What I'm looking for is basically what You said, some .js function isValid() that I can pass the vat id type (i.e. us_ein) and the current user input to in order to check if the API is gonna throw an exception.

arctic cedar
#

Unfortunately I am not finding anything like that in our client side library at the moment. Will definitely feature request for it.

#

I do see our Customer Portal can take Tax IDs, looking to see if we have client side validation there

keen inlet
#

Great thanks for checking! What I could also work with is doing the validation server sided and have the corresponding function called via ajax. However I haven't been able to find anything about that either :/