- PHP
Enabling Stripe Tax
In the create-checkout-session.php
file you will find the following code commented out
// 'automatic_tax' => ['enabled' => true],
Uncomment this line of code and the sales tax will be automatically calculated during the checkout.
Make sure you previously went through the set up of Stripe Tax: Set up Stripe Tax and you have your products and prices updated with tax behavior and optionally tax codes: Docs - Update your Products and Prices
- Run composer to set up dependencies
composer install
- Copy .env.example to .env and replace with your Stripe API keys and set a Basic and Pro price
cp .env.example .env
- Run the server locally
cd public
php -S localhost:4242
- Go to localhost:4242