Saturday, 06 Apr, 2024 -152

Paypal Payment Gateway Integration With Laravel

Hi, friends. How are you all doing? I hope you all have continued success and good health. This time, we'll talk about integrating Paypal with Laravel. Those of you with sales websites will find this tutorial to be very helpful.

Paypal is a global payment option that is compatible with most nations that allow online money transfers. Paypal offers a more rapid and secure method of money transfers. The majority of e-commerce companies use Paypal to receive payments from clients because of its widespread use.

We will incorporate the Paypal payment gateway into a Laravel application in this post. This e-commerce website makes use of the Laravel framework for backend development. We'll go over everything step-by-step right from the start.

Take the actions listed below:

1.Use Composer to Create a New Project and Install Packages for the Paypal Payment Gateway
3.Make a PayPal account and fund it.
4.Set up the bundle.
5.Establish Routes
6.To make a payment button, generate a blade file.
7.Launch the application

### First time create controller PaypalController.php

here create one method for view paypal payment form 

page name paypalwithpay.php

Install paypal package 

composer create-project laravel/laravel paypal --prefer-dist

Then

Create page inside of laravel config folder [Paypal.php]

When create this page here configure your paypal client -id and secrete key



Create Paywith paypal page 

<html>
<head>
	<meta charset="utf-8">
	<title>How to integrate paypal payment in Laravel - Techsolutionstuff</title>
	<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
    <div class="row">    	
        <div class="col-md-8 col-md-offset-2">        	
        	<h3 class="text-center" style="margin-top: 90px;">How to integrate paypal payment in Laravel - Techsolutionstuff</h3>
            <div class="panel panel-default" style="margin-top: 60px;">

                @if ($message = Session::get('success'))
                <div class="custom-alerts alert alert-success fade in">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                    {!! $message !!}
                </div>
                <?php Session::forget('success');?>
                @endif

                @if ($message = Session::get('error'))
                <div class="custom-alerts alert alert-danger fade in">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                    {!! $message !!}
                </div>
                <?php Session::forget('error');?>
                @endif
                <div class="panel-heading"><b>Paywith Paypal</b></div>
                <div class="panel-body">

                    <form class="form-horizontal" method="POST" id="payment-form" role="form" action="{!! URL::route('paypal') !!}" >
                        {{ csrf_field() }}

                        <div class="form-group{{ $errors->has('amount') ? ' has-error' : '' }}">
                            <label for="amount" class="col-md-4 control-label">Enter Amount</label>

                            <div class="col-md-6">
                                <input id="amount" type="text" class="form-control" name="amount" value="{{ old('amount') }}" autofocus>

                                @if ($errors->has('amount'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('amount') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Paywith Paypal
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>


 When click submit button it hit paypalcontroller   method postPaymentWithpaypal()

source code here https://github.com/alaminsobuj/laravel-paypal-gateway.git

Tags: paypal
Tags
Most Popular
img
How to install WordPress
02 Apr, 2024 view: 1957
img
Xampp Tutorial Create Your Own Local Test Server
02 Apr, 2024 view: 885
img
How to Install Laravel
02 Apr, 2024 view: 819
img
PHP is not recognized as an internal or external command
02 Apr, 2024 view: 610
img
How to Install Composer on Windows
01 Apr, 2024 view: 607
img
Summernote image upload
01 Nov, 2023 view: 553
img
How to clear select2 selected value in js
01 Nov, 2023 view: 426
img
Zipping and Unzipping Files in Linux
02 Apr, 2024 view: 376
img
How to add Datepicker in Bootstrap
26 Apr, 2024 view: 371
img
How to Import a MySQL Database using Command Line
02 Apr, 2024 view: 365
img
How to Installation Laragon
01 Apr, 2024 view: 212
img
How to Installing an SSL certificate on your server using cPanel
06 Apr, 2024 view: 183
img
Paypal Payment Gateway Integration With Laravel
06 Apr, 2024 view: 152
img
How to Use Laravel Middleware to Protect Your Application
09 Apr, 2024 view: 144
img
Laravel Cache Clear Command Php Artisan Optimize
09 Apr, 2024 view: 144
img
why important website development learn
10 Apr, 2024 view: 136
img
How to Integrate Stripe Payment in Laravel
06 Apr, 2024 view: 134
img
Laravel Authentication Tutorial
09 Apr, 2024 view: 133
img
laravel qr code generator package
18 Apr, 2024 view: 131
Trending