Stripe Payment Gateway Integration in Laravel 5.8
https://www.itsolutionstuff.com/post/stripe-payment-gateway-integration-in-laravel-58example.html
Stripe Payment Gateway Integration in Laravel 5.8
By Hardik Savani June 1, 2019 Category : PHP LaravelPauseUnmuteLoaded: 2.85%Fullscreen
In this tutorial, i will guide you step by step laravel 5.8 stripe integration example from scratch. you will learn to implement stripe payment gateway integration with your laravel 5.8 application.
You need to create stripe developer account and need to get api key and secret from there. Then we will use stripe/stripe-php composer library for stripe payment gateway in laravel 5.8. I write step by step integration for stripe payment gateway.
Stripe is a very popular and secure internet payment gateway company which helps to accept payment worldwide. Stripe provide really nice development interface to start and you don’t have to pay subscription charges to learn it provides free developer account, before starting to code in your app.
Follow Tuto: Payment Processing by HighRiskPay
I will give you example from scratch to implement stripe payment gateway in laravel 5.8 application. You just need to follow few step to get full example to pay.

Step 1: Install Laravel 5.8
I am going to explain step by step from scratch so, we need to get fresh Laravel 5.8 application using bellow command, So open your terminal OR command prompt and run bellow command:
Step 2: Install stripe-php Package
In this step we need to install stripe-php via the Composer package manager, so one your terminal and fire bellow command:
Step 3: Set Stripe API Key and SECRET
Now, we need to set stripe key and secret. so first you can go on Stripe website and create development stripe account key and secret and add bellow:
.env
Step 4: Create Routes
In this step, we will create two routes for get request and another for post request. So, let's add new route on that file.
routes/api.php
Step 5: Create Controller File
in next step, now we have create new controller as StripePaymentController and write both method on it like as bellow, So let's create both controller:
app/Http/Controllers/StripePaymentController.php
Step 6: Create Blade File
In Last step, let's create stripe.blade.php(resources/views/stripe.blade.php) for layout and write code of jquery to get token from stripe here and put following code:
resources/views/stripe.blade.php
Read Also: Laravel 5.8 Login with Google Account Example
Now you can check with following card details:
Name: Test
Number: 4242 4242 4242 4242
CSV: 123
Expiration Month: 12
Expiration Year: 2024
I hope it can help you...
Last updated