Oliver Servín
Desarrollador y creador
Oliver Servín
11 de noviembre, 2021

Tax calculation with Laravel Cashier for Stripe

Dealing with Tax calculation on checkout pages always makes me sweat, especially EU Taxes. Luckily, Stripe and Laravel Cashier, in recent releases, have simplified it.

You only need to add calculateTaxes method in your AppServiceProvider, and it will automate the tax collection and calculation using Stripe Tax service.

1// App\Providers\AppServiceProvider.php
3use Laravel\Cashier\Cashier;
5public function boot ()
7 Cashier::calculateTaxes();

Stripe's payment page starts collecting and calculating taxes from your customers.