stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.76k stars 270 forks source link

Request: A new Tax ID component #110

Closed CruelMoney closed 3 years ago

CruelMoney commented 4 years ago

Summary

A Tax ID component identical to the one used in the stripe dashboard. Including the country selection and validation on the value.

Motivation

Implementing a tax ID component for every country is time-consuming. Especially gathering the correct names and structure of the ID for each country.

Similar APIs

The API would be similar to the existing react Elements.

Alternatives

Making the component from scratch.

Scope

The component would include a country drop down selector and an input field that changes its' label and placeholder based on the selected country. Some basic length validation based on the country.

Risks

Users might confuse the component for a tax rate component.

hofman-stripe commented 4 years ago

I'm wondering if you could tell us a little more about your use case? The goal of Elements is to securely collect payments data from end customers and send it to the Stripe API. The only Tax Id usage I'm aware of in the Stripe API is for Billing. Is your goal to collect and add a Tax Id to a customer object? This would require API changes as well, as currently that operation can only be performed from your server with a secret key.

CruelMoney commented 4 years ago

I'm wondering if you could tell us a little more about your use case?

Yes, it's for collecting tax ids from users. Pure convenience. I ended up making it from scratch by looking through the stripe documentation and looking at the tax id input in the Stripe customer dashboard.

dweedon-stripe commented 3 years ago

Hi @CruelMoney,

Sorry for the delay here, and I'm glad you were able to something working. I'm going to file this in our internal issue tracker. We are currently thinking about ways to make more complex payment flows easier, and supporting tax id collection is super interesting.

I am going to go ahead and close this out since we try to keep the issues here specific to issues with React Stripe.js. I'll post here if we have any updates.

psociety commented 1 year ago

I'm wondering if you could tell us a little more about your use case? The goal of Elements is to securely collect payments data from end customers and send it to the Stripe API. The only Tax Id usage I'm aware of in the Stripe API is for Billing. Is your goal to collect and add a Tax Id to a customer object? This would require API changes as well, as currently that operation can only be performed from your server with a secret key.

Think of charging a company. They need to have the vat/tax id on the invoice so they can get back the taxes. Elements is useless for company payments without it :(

@CruelMoney could you share the component that you made?

atzt commented 5 hours ago

My team would like this tax ID component as well. The tax collection workflow on the checkout page is great but we are unfortunately not able to use that process due to a limitation on a 3rd party plugin for Stripe. So we are forced to create our own custom checkout page using the Stripe elements and the setup intent API.

We are going to attempt to add an <input> for the tax ID next to the<AddressElement> and submit the tax ID in the customer's phone number field since there does not seem a way to submit metadata using the setup intent API. Hopefully that hack will work. 🤞