Laravel

Paypal integration in laravel 5.4

Paypal integration in laravel 5.4

Paypal integration in laravel 5.4. When we are going to build a e-commerce website we must have any one payment geteway to make a payment. Paypal is a global and common way to send a money by online. Lets see how to integrate paypal payment gateway in laravel 5.4

Step 1 : Install laravel 5.4

It will install the latest version of laravel to your application

Step 2 : Configure your database

In mycase :

Step 3 : Install guzzlehttp

It will install latest version of guzzlehttp



Step 4 : Install Paypal PHP SDK

It will install latest php-paypal-rest-apk to your vendor folder

Step : 5 Run vendor publish command

It will publish paypal.php file under config folder. If it does’t create a paypal.php dont panic just create it manually.

config/paypal.php

Step 6 : Create a Route to add payment details and make payment

routes/web.php

Step 7 : Create Controller

app/Http/Controllers/PaypalController.php

Run below command to create a PaypalController file.

Replace PaypalController.php with below code

Step 8 : Create blade file to enter item details

resources/paywithpaypal.blade.php

Run your application in browser

Eg : http://localhost:8888/Paypal integration/laravel54/public/checkout

Note : You should login before try checkout. If you face paypal unsupported ssl protocol version error, Please check ssl is enabled in your curl version at phpinfo()

Paypal integration Demo Outputs

Paypal integration in laravel 5.4

Paypal integration in laravel 5.4

Paypal integration in laravel 5.4

Paypal integration in laravel 5.4

Thats it, Now you can simply make Paypal integration in laravel.