PHPackages                             webfactorybulgaria/laravel-shop-gateway-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. webfactorybulgaria/laravel-shop-gateway-paypal

ActiveLibrary[Payment Processing](/categories/payments)

webfactorybulgaria/laravel-shop-gateway-paypal
==============================================

PayPal gateway for Laravel Shop package.

v4.1.1(9y ago)06711MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (3)Used By (1)

PAYPAL GATEWAY (for Laravel Shop Package)
-----------------------------------------

[](#paypal-gateway-for-laravel-shop-package)

[![Latest Stable Version](https://camo.githubusercontent.com/01d315b0dc4e2a1c183abbc175b840b26b5877694a733e78937f52f5954bd367/68747470733a2f2f706f7365722e707567782e6f72672f616d7367616d65732f6c61726176656c2d73686f702d676174657761792d70617970616c2f762f737461626c65)](https://packagist.org/packages/amsgames/laravel-shop-gateway-paypal)[![Total Downloads](https://camo.githubusercontent.com/a4c2fa9add7223103d405057b78ae3f7d65a26896bfa12873cbb10f76600d935/68747470733a2f2f706f7365722e707567782e6f72672f616d7367616d65732f6c61726176656c2d73686f702d676174657761792d70617970616c2f646f776e6c6f616473)](https://packagist.org/packages/amsgames/laravel-shop-gateway-paypal)[![License](https://camo.githubusercontent.com/fa1209a3cab57e43848234426aa05c71e3677bcecbd620e62da08a234b41c9df/68747470733a2f2f706f7365722e707567782e6f72672f616d7367616d65732f6c61726176656c2d73686f702d676174657761792d70617970616c2f6c6963656e7365)](https://packagist.org/packages/amsgames/laravel-shop-gateway-paypal)

PayPal Gateway solution for [Laravel Shop](https://github.com/amsgames/laravel-shop).

Gateways
--------

[](#gateways)

This package comes with:

- Direct Credit Card payments
- PayPal Express payments

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
    - [Authentication](#authentication)
- [Gateway Usage](#gateway-usage)
    - [Direct Credit Card](#direct-credit-card)
    - [PayPal Express](#paypal-express)
        - [Configuration](#configuration-1)
        - [Usage](#usage)
- [License](#license)
- [Additional Information](#aditional-information)

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

[](#installation)

In order to install Laravel Shop, you can run

```
"amsgames/laravel-shop-gateway-paypal": "v1.0.0"
```

to your composer.json. Then run `composer install` or `composer update`.

Then in your `config/shop.php` add

```
'paypal'            =>  Amsgames\LaravelShopGatewayPaypal\GatewayPayPal::class,
'paypalExpress'     =>  Amsgames\LaravelShopGatewayPaypal\GatewayPayPalExpress::class,
```

in the `gateways` array.

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

[](#configuration)

### Authentication

[](#authentication)

Set your PayPal app authentication credentials in `config/services.php`, like:

```
    'paypal' => [
        'client_id' => env('PAYPAL_CLIENT_ID', ''),
        'secret' => env('PAYPAL_SECRET', ''),
        'sandbox' => env('PAYPAL_SANDBOX', true),
    ],
```

**NOTE:** Change `sandbox` to false when going live.

Gateway Usage
-------------

[](#gateway-usage)

### Direct Credit Card

[](#direct-credit-card)

The only additional step needed for this to work is to add the credit card information before `checkout` and before `order placement`, like:

```
// (1) - Set gateway
Shop::setGateway('paypal');

// (2) - Add credit card for validation
Shop::gateway()->setCreditCard(
  $cartType   = 'visa',
  $cardNumber = '4111111111111111',
  $month      = '1',
  $year       = '2019',
  $cvv        = '123',
  $firstname  = 'John',
  $lastname   = 'Doe'
);

// (3) - Call checkout
if (!Shop::checkout()) {
  echo Shop::exception()->getMessage(); // echos: card validation error.
}

// (4) - Create order
$order = Shop::placeOrder();

// (5) - Review payment
if ($order->hasFailed) {

  echo Shop::exception()->getMessage(); // echos: payment error.

}
```

**NOTE:** If you are calling `Shop::checkout()` in a different controller or view than `Shop::placeOrder`, be sure to recall `setCreditCard()` before calling `Shop::placeOrder()` in your second controller. This package does not stores credit card data.

**RECOMMENDATION:** Use SSL to secure you checkout flow when dealing with credit cards.

### PayPal Express

[](#paypal-express)

If you don't want to deal with credit card forms and SSL, you can us PayPal Express instead. PayPal Express handles the payment process outside your website and returns with the results.

Look at [PayPal's documentation](https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECGettingStarted/) for more information about this process.

#### Configuration

[](#configuration-1)

PayPal will callback Laravel Shop and this gateway with the results. Laravel Shop will then redirect the customer to the route name set in `config/shop.php` and will pass by as parameter the `Order Id`. Set up this route before using this gateway.

```
    /*
    |--------------------------------------------------------------------------
    | Redirect route after callback
    |--------------------------------------------------------------------------
    |
    | Which route to call after the callback has been processed.
    |
    */
    'callback_redirect_route' => 'home',
```

#### Usage

[](#usage)

```
// (1) - Set gateway
Shop::setGateway('paypalExpress');

// (2) - Call checkout / OPTIONAL
// You can call this to keep a standard flow
// Although this step for this gateway is not needed.
Shop::checkout();

// (3) - Create order
$order = Shop::placeOrder();

// (4) - Review order and redirect to payment
if ($order->isPending) {

  // PayPal URL to redirect to proceed with payment
  $approvalUrl = Shop::gateway()->getApprovalUrl();

  // Redirect to url
  return redirect($approvalUrl);
}

// (5) - Callback
// You don't have to do anything.
// Laravel Shop will handle the callback and redirect the customer to the configured route.
```

License
-------

[](#license)

This package is free software distributed under the terms of the MIT license.

Additional Information
----------------------

[](#additional-information)

This package uses the official [PayPal PHP SDK](https://github.com/paypal/PayPal-PHP-SDK).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3427d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1948577?v=4)[Webfactory](/maintainers/webfactorybulgaria)[@webfactorybulgaria](https://github.com/webfactorybulgaria)

---

Top Contributors

[![webfactorybulgaria](https://avatars.githubusercontent.com/u/1948577?v=4)](https://github.com/webfactorybulgaria "webfactorybulgaria (1 commits)")

---

Tags

gatewaypaypallaravel-shop

### Embed Badge

![Health badge](/badges/webfactorybulgaria-laravel-shop-gateway-paypal/health.svg)

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

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725173.2k14](/packages/tallstackui-tallstackui)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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