Skip to content

jordigasso/stripe-php-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Checkout for a subscription with PHP

Requirements

  • PHP

How to run

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

  1. Run composer to set up dependencies
composer install
  1. Copy .env.example to .env and replace with your Stripe API keys and set a Basic and Pro price
cp .env.example .env
  1. Run the server locally
cd public
php -S localhost:4242
  1. Go to localhost:4242

About

Stripe checkout integration with PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published