PHPackages                             sger/laravel-paypal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. sger/laravel-paypal

ActiveLibrary[Payment Processing](/categories/payments)

sger/laravel-paypal
===================

A Paypal bridge for Laravel

0.1(9y ago)61701[1 issues](https://github.com/sger/laravel-paypal/issues)MITPHPPHP ^5.5.9 || ^7.0

Since Jul 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sger/laravel-paypal)[ Packagist](https://packagist.org/packages/sger/laravel-paypal)[ RSS](/packages/sger-laravel-paypal/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (2)Used By (0)

Laravel Paypal
==============

[](#laravel-paypal)

[![Build Status](https://camo.githubusercontent.com/588efe428ed029f56204fa6768e0f3f7a2e89fa2ff1f376f42b212d33a54dcc7/68747470733a2f2f7472617669732d63692e6f72672f736765722f6c61726176656c2d70617970616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sger/laravel-paypal)[![Code Climate](https://camo.githubusercontent.com/03a61fb3f72457e85a70262d030d8eaaf01ac84223bca2abdb62dc6a472fd77f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736765722f6c61726176656c2d70617970616c2f6261646765732f6770612e737667)](https://codeclimate.com/github/sger/laravel-paypal)[![Test Coverage](https://camo.githubusercontent.com/48d00c20d4a974f5831abb9da8c6ad2b063ef8f6dbafc74540c8de63bd4c01fd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736765722f6c61726176656c2d70617970616c2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/sger/laravel-paypal/coverage)[![Issue Count](https://camo.githubusercontent.com/018c6f4aebc51c3fc23a8c398025260225746f898bf0f02165769344df2bf6ee/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736765722f6c61726176656c2d70617970616c2f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/sger/laravel-paypal)

Laravel Paypal is a bridge for Laravel 5 using the [PHP SDK for PayPal RESTful APIs Package](https://github.com/paypal/PayPal-PHP-SDK).This package is inspired by .

Installation
------------

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
composer require sger/laravel-paypal
```

Add the service provider to `config/app.php` in the `providers` array.

```
Sger\Paypal\PaypalServiceProvider::class
```

```
'Paypal' => Sger\Paypal\Facades\Paypal::class
```

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish
```

This will create a `config/paypal.php` file in your app which contains two types of connection 'sandbox' and 'live'.

Usage
-----

[](#usage)

In your routes.php create for example:

```
Route::resource('payments', 'PaymentsController');
```

next in your controller in your store method add the following code:

```
$payer = new Payer;
$payer->setPaymentMethod("paypal");

$item1 = new Item();
$item1->setName('test')
	->setCurrency('EUR')
	->setQuantity(1)
	->setPrice(10);

$itemList = new ItemList();
$itemList->setItems(array($item1));

$amount = new Amount();
$amount->setCurrency('EUR')
	->setTotal(10);

$transaction = new Transaction();
$transaction->setAmount($amount)
	->setItemList($itemList)
	->setDescription("Payment description")
	->setInvoiceNumber(uniqid());

$baseUrl = \URL::to('/');

$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl("$baseUrl/execute-payment?success=true")
->setCancelUrl("$baseUrl/execute-payment?success=false");

$payment = new Payment();

$payment->setIntent("sale")
	->setPayer($payer)
	->setRedirectUrls($redirectUrls)
	->setTransactions(array($transaction));

try {
	$payment->create(\Paypal::connection('sandbox'));
} catch (\PPConnectionException $ex) {
	return  "Exception: " . $ex->getMessage() . PHP_EOL;
	exit(1);
}

$approvalUrl = $payment->getApprovalLink();
// redirect user to the $approvalUrl
```

License
-------

[](#license)

Laravel Paypal is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3644d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/118588?v=4)[Spiros Gerokostas](/maintainers/sger)[@sger](https://github.com/sger)

---

Top Contributors

[![sger](https://avatars.githubusercontent.com/u/118588?v=4)](https://github.com/sger "sger (13 commits)")

---

Tags

laravelpaypal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sger-laravel-paypal/health.svg)

```
[![Health](https://phpackages.com/badges/sger-laravel-paypal/health.svg)](https://phpackages.com/packages/sger-laravel-paypal)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M282](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[illuminate/database

The Illuminate Database package.

2.8k54.1M11.2k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M165](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
