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

ActiveLibrary[Payment Processing](/categories/payments)

amsgames/laravel-shop-gateway-paypal
====================================

PayPal gateway for Laravel Shop package.

v1.0.1(10y ago)1210.8k↓48.9%13[1 issues](https://github.com/amsgames/laravel-shop-gateway-paypal/issues)6MITPHPPHP &gt;=5.4.0

Since Jun 25Pushed 10y ago2 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (5)Used By (6)

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

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

3

Last Release

3895d ago

### Community

Maintainers

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

---

Tags

gatewaypaypallaravel-shop

### Embed Badge

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

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

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[amsgames/laravel-shop

Package set to provide shop or e-commerce functionality (such as CART, ORDERS, TRANSACTIONS and ITEMS) to Laravel for customizable builds.

4775.9k](/packages/amsgames-laravel-shop)

PHPackages © 2026

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