PHPackages                             pleets/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. pleets/laravel-paypal

ActiveLibrary[Payment Processing](/categories/payments)

pleets/laravel-paypal
=====================

Paypal Integrations

v0.4.0(5y ago)01.2kMITPHPPHP ^7.4|^8.0

Since Dec 1Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/61dfac2c0269a52ed1ae9ddbdabe68d861a666efd233ed83d1fe1194e7b27938/68747470733a2f2f626c6f672e706c656574732e6f72672f696d672f61727469636c65732f6c61726176656c2d70617970616c2d69636f6e2e706e67)](https://camo.githubusercontent.com/61dfac2c0269a52ed1ae9ddbdabe68d861a666efd233ed83d1fe1194e7b27938/68747470733a2f2f626c6f672e706c656574732e6f72672f696d672f61727469636c65732f6c61726176656c2d70617970616c2d69636f6e2e706e67)

[![Build Status](https://camo.githubusercontent.com/b449499aa64db01c88f2d9549163ca6144a9568311f8fd61a638be16f29a7606/68747470733a2f2f7472617669732d63692e6f72672f706c656574732f6c61726176656c2d70617970616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pleets/laravel-paypal)[![Code Quality](https://camo.githubusercontent.com/b34818ebb22554023cbb0e00866a9f68f2a8246a706f89df7d3dab06944c359d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706c656574732f6c61726176656c2d70617970616c2e737667)](https://scrutinizer-ci.com/g/pleets/laravel-paypal)[![Bugs](https://camo.githubusercontent.com/1bbb7c56eb01ddf07f8699548ea45c9d188294db45e75534504a08f4e7547d63/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d706c656574735f6c61726176656c2d70617970616c266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=pleets_laravel-paypal)[![Code Coverage](https://camo.githubusercontent.com/36b883fd8a2d1cdb28fc68844dd35ac9a8d55a90b7ce58924c9872733365f7e9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706c656574732f6c61726176656c2d70617970616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pleets/laravel-paypal/?branch=master)

Laravel integrator for PayPal solutions. Actually this library supports the following solutions:

- [Checkout](#31-checkout)
- [Subscriptions](#32-subscriptions)

1. Requirements
---------------

[](#1-requirements)

You need to make sure your server meets the following requirements.

- PHP &gt;= 7.4, PHP &gt;= 8.0
- Laravel 7.x, 8.x

2. Installation
---------------

[](#2-installation)

Use following command to install this library:

```
composer require pleets/laravel-paypal
```

Add the service provider to your `providers[]` array in `config/app.php` file like:

```
\Pleets\LaravelPayPal\LaravelPaypalProvider::class
```

Finally, publish the vendor files.

```
php artisan vendor:publish --tag="laravel-paypal"
```

3. Usage
--------

[](#3-usage)

3.1 Live and Sandbox environments
---------------------------------

[](#31-live-and-sandbox-environments)

Set up first API credentials for sandbox with the following env vars.

```
PAYPAL_SANDBOX_CLIENT_ID=
PAYPAL_SANDBOX_SECRET=
```

For live environment set up the following.

```
PAYPAL_LIVE_CLIENT_ID=
PAYPAL_LIVE_SECRET=
```

You can choose your current environment with the following.

```
PAYPAL_ENVIRONMENT=sandbox
```

The only valid values for this are `sandbox` and `live`.

3.2 Checkout
------------

[](#32-checkout)

Activate paypal checkout with the following env var.

```
PAYPAL_CHECKOUT_ACTIVATED=true
```

Add the PayPal SDK to your blade templates as follows

```
@include('laravel-paypal::checkout.sdk')
```

💡 You don't have to be worried about when to include this SDK. The component checks for `PAYPAL_CHECKOUT_ACTIVATED`and then include the JavaScript SDK in case the value were true.

Then you can add the Smart Payment Button like this

```
@include('laravel-paypal::checkout.button')
```

⚠️ Finally, after the code of this button add the javascript code to handle it. This JS file is not intended to be used for production. It is just an example about how to handle the PayPal button.

```

```

The `checkout.js` file contains values related to the purchase amount and purchase behaviour. For other values you can check the [official documentation](https://developer.paypal.com/docs/api/orders/v2#orders_create).

3.3 Subscriptions
-----------------

[](#33-subscriptions)

Activate paypal subscriptions with the following en var.

```
PAYPAL_SUBSCRIPTION_ACTIVATED=true
```

You can interact with subscriptions Api through this [PayPal SDK](payment-gateways/paypal-sdk). Add the service provider to your `providers[]` array in `config/app.php` file like:

```
Pleets\LaravelPayPal\Providers\PayPalServiceProvider::class
```

Add the PayPal SDK to your blade templates as follows

```
@include('laravel-paypal::subscriptions.sdk')
```

💡 You don't have to be worried about when to include this SDK. The component checks for `PAYPAL_SUBSCRIPTION_ACTIVATED`and then include the JavaScript SDK in case the value were true.

Then you can add the Smart Payment Button like this

```
@include('laravel-paypal::subscriptions.button')
```

⚠️ Finally, after the code of this button add the javascript code to handle it. This JS file is not intended to be used for production. It is just an example about how to handle the PayPal button.

```

```

The `subscriptions.js` file contains values related to creating subscriptions and purchase behaviour. For other values you can check the [official documentation](https://developer.paypal.com/docs/subscriptions/integrate/#create-the-subscription).

4. Mocking
----------

[](#4-mocking)

If you want to mock the PayPal Service for testing purposes, you need to overwrite the paypal testing configuration. You must create a `testing.php` file inside `config/paypal` folder and set up a specific handler like this.

```
'handler' => [
    'class' => PaymentGateway\PayPalApiMock\PayPalApiMock::class,
]
```

Feel free to use your own paypal mock, or you can use this [PayPal Api Mock](https://github.com/payment-gateways/paypal-api-mock).

Finally, you should set up the following in your testing environment.

```
PAYPAL_HANDLER_ENABLED=true
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~21 days

Total

4

Last Release

1922d ago

PHP version history (2 changes)v0.2.0PHP 7.4.\*

v0.4.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/da87983fc787b1876917187cf3f37a66659e1e3f81ff5fec88cd43b6140a1bda?d=identicon)[fermius](/maintainers/fermius)

---

Top Contributors

[![darioriverat](https://avatars.githubusercontent.com/u/5879790?v=4)](https://github.com/darioriverat "darioriverat (56 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[ssheduardo/redsys-laravel

Package redsys for laravel

100129.5k1](/packages/ssheduardo-redsys-laravel)[duncanmcclean/simple-commerce

A simple, yet powerful e-commerce addon for Statamic.

16313.2k2](/packages/duncanmcclean-simple-commerce)[tsaiyihua/laravel-ecpay

ecpay library for laravel

6416.3k](/packages/tsaiyihua-laravel-ecpay)[alifaraun/laravel-moamalat-pay

Easy - Moamalat Lightbox integration for Laravel.

1914.0k](/packages/alifaraun-laravel-moamalat-pay)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

322.8k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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