PHPackages                             bgaetealvear/paypal-laravel-58 - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. bgaetealvear/paypal-laravel-58

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bgaetealvear/paypal-laravel-58
==============================

Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.

v1.0.1(4y ago)012MITPHP

Since Aug 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/BGaeteAlvear/laravel-paypal-58)[ Packagist](https://packagist.org/packages/bgaetealvear/paypal-laravel-58)[ RSS](/packages/bgaetealvear-paypal-laravel-58/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel PayPal
==============

[](#laravel-paypal)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/d86c7790cc4ab0f525ad4c27b5ca7d1e080e046f843fd686d769f4c618efd2f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626761657465616c766561722f70617970616c2d6c61726176656c2d35382e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bgaetealvear/paypal-laravel-58)

- [Introduction](#introduction)
- [PayPal API Credentials](#paypal-api-credentials)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Support](#support)

Introduction
------------

[](#introduction)

By using this plugin you can process or refund payments and handle IPN (Instant Payment Notification) from PayPal in your Laravel application.

**This plugin supports the new paypal rest api.**

PayPal API Credentials
----------------------

[](#paypal-api-credentials)

This package uses the new paypal rest api. Refer to this link on how to create API credentials:

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

[](#installation)

- Use following command to install:

```
composer require bgaetealvear/paypal-laravel-58
```

Perform the following steps if you are using Laravel 5.4 or less.

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

```
BGaeteAlvear\PayPal\Providers\PayPalServiceProvider::class
```

- Add the alias to your `aliases[]` array in `config/app.php` file like:

```
'PayPal' => BGaeteAlvear\PayPal\Facades\PayPal::class
```

- Run the following command to publish configuration:

```
php artisan vendor:publish --provider "BGaeteAlvear\PayPal\Providers\PayPalServiceProvider"
```

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

[](#configuration)

- After installation, you will need to add your paypal settings. Following is the code you will find in **config/paypal.php**, which you should update accordingly.

```
return [
    'mode'    => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used.
    'sandbox' => [
        'client_id'         => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_SANDBOX_CLIENT_SECRET', ''),
        'app_id'            => 'APP-80W284485P519543T',
    ],
    'live' => [
        'client_id'         => env('PAYPAL_LIVE_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_LIVE_CLIENT_SECRET', ''),
        'app_id'            => '',
    ],

    'payment_action' => env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order'
    'currency'       => env('PAYPAL_CURRENCY', 'USD'),
    'notify_url'     => env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application.
    'locale'         => env('PAYPAL_LOCALE', 'en_US'), // force gateway language  i.e. it_IT, es_ES, en_US ... (for express checkout only)
    'validate_ssl'   => env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client.
];
```

- Add this to `.env.example` and `.env`

```
#PayPal Setting & API Credentials - sandbox
PAYPAL_SANDBOX_CLIENT_ID=
PAYPAL_SANDBOX_CLIENT_SECRET=

#PayPal Setting & API Credentials - live
PAYPAL_LIVE_CLIENT_ID=
PAYPAL_LIVE_CLIENT_SECRET=

```

Usage
-----

[](#usage)

Following are some ways through which you can access the paypal provider:

```
// Import the class namespaces first, before using it directly
use BGaeteAlvear\PayPal\Services\PayPal as PayPalClient;

$provider = new PayPalClient;

// Through facade. No need to import namespaces
$provider = PayPal::setProvider();
```

Override PayPal API Configuration
---------------------------------

[](#override-paypal-api-configuration)

You can override PayPal API configuration by calling `setApiCredentials` method:

```
$provider->setApiCredentials($config);
```

Get Access Token
----------------

[](#get-access-token)

After setting the PayPal API configuration by calling `setApiCredentials` method. You need to get access token before performing any API calls

```
$provider->getAccessToken();
```

Set Currency
------------

[](#set-currency)

By default the currency used is `USD`. If you wish to change it, you may call `setCurrency` method to set a different currency before calling any respective API methods:

```
$provider->setCurrency('EUR');
```

Support
-------

[](#support)

This plugin only supports Laravel 5.1 to 5.8.

- In case of any issues, kindly create one on the [Issues](https://github.com/bgaetealvear/paypal-laravel-58/issues) section.
- If you would like to contribute:
    - Fork this repository.
    - Implement your features.
    - Generate pull request.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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 ~3 days

Total

2

Last Release

1716d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26167958?v=4)[Brian Gaete Alvear](/maintainers/bgaetealvear)[@BGaeteAlvear](https://github.com/BGaeteAlvear)

---

Top Contributors

[![BGaeteAlvear](https://avatars.githubusercontent.com/u/26167958?v=4)](https://github.com/BGaeteAlvear "BGaeteAlvear (3 commits)")

---

Tags

httprestweb servicepaypallaravel paypal

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[srmklive/paypal

Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.

1.1k3.8M26](/packages/srmklive-paypal)[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[apoca/laravel-sibs-payments

Laravel library to communicate with SIBS - Open Payment Platform.

342.3k](/packages/apoca-laravel-sibs-payments)

PHPackages © 2026

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