How to Integrate Stripe Payment Gateway in Laravel

In  this article, we are going to explain “How to integrate Stripe Payment gateway in laravel”. In many websites required payment gateway like Paypal,Stripe,Authorize etc.

Stripe payment:-

Stripe is one of the most popular payment gateway which is integrated in many websites, Stripe payment is easy to integrate and use. Stripe is very simple and most powerful and flexible tools.

Step 1:- First we need to install required packages cartalyst/stripe-laravel, So open your composer.json file and put following one package in require array.

Then After update composer by run following command.

It will take some time and installed required package “cartalyst/stripe-laravel”

Step 2:- Now  need to configure package in config/app.php, So open app.php file and paste below code in app.php file.

Step 3:- Now in this step need to configure STRIPE_KEY and STRIPE_SECRATE in .env file.

Step 4:- Now we are require two route one for display payment form and second is required for post request to stripe, So open your web.php file and put the following code in routes/web.php.

Step 5:- Now create StripeController.php file in app/http/controllers

Step 6:- And in the last step create view file in resources/view folder paywithstripe.blade.php and paste below code in view file.

Now stripe payment all steps completed and ready to test, for testing first need to start serve, for that run below command and then test payment.

And now you can open below url for testing….

Now use dummy/test credit card for payment. if your payment is successfully done then you can change your payment mode test to live.

We hope this post is very helpful for integrate stripe in laravel. If you need paypal or ccavenue payment gateway then you can also read paypal payment gateway integration and CCAvenue payment gateway etc.




Leave a Comment