Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Need help with Cashier and tax identification number

Hello,

I have added this line in the app service provider.

Cashier::calculateTaxes();

Such a way, I don't have to handle taxes, they are automatically calculated, it works fine. I have also customized the customer datas, it works fine too. For this, I have overloaded the fields, for example with stripeName().

I'm using checkout to display the view for the customer to pay : he can type his name and credit card informations.

There is also a checkbox the customer has to check if he is a professionnal : he can type his company's name and the tax identification number.

The application is only for professionals. How is it possible to automatically check this box and fill the fields with values from the database (the customer will have to save his tax identification number in the application, and his company's name too) ?

I think that it's possible to execute $user->addTaxId('eu_vat', $user->tax_id);, but it's only the tax id, I don't have the company's name.

Furthermore do I have to handle eu_vat locally or is it a way so that Stripe guess this information from the customer address ?

Thanks for your help.

V

0 likes
3 replies
vincent15000's avatar

The solution : I just have to add $user->addTaxId('eu_vat', 'FRAB123456789');.

But I still have a problem : do I have to select manually the right type eu_vat ? Or is it possible to let stripe identify the right one ?

Is there any database / CSV file with all available types according to the countries / states ?

Thanks for your help.

V

vincent15000's avatar

@jlrdw Thank you, I already have seen this page.

I think that I will have to add the countries manually in the database with the right tax types and then create the appropriate tax id.

Please or to participate in this conversation.