PHPackages                             shaanid/paypal-package - 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. shaanid/paypal-package

ActiveLibrary[Payment Processing](/categories/payments)

shaanid/paypal-package
======================

A PayPal integration package for Laravel.

v1.0.0(3mo ago)01MITPHPPHP ^8.2

Since Feb 7Pushed 3mo agoCompare

[ Source](https://github.com/shaanid/paypal-package)[ Packagist](https://packagist.org/packages/shaanid/paypal-package)[ RSS](/packages/shaanid-paypal-package/feed)WikiDiscussions main Synced 1mo ago

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

PayPal Laravel Package
======================

[](#paypal-laravel-package)

A production-standard Laravel package for PayPal REST API integration, featuring robust error handling, transaction persistence, and audit logging.

🚀 Features
----------

[](#-features)

- **Service-Oriented Architecture**: Decoupled payment logic.
- **Database Persistence**: Automatic tracking of every transaction (Pending, Completed, Canceled, Failed).
- **Audit Logging**: Full traceability of API requests and responses.
- **Action Pattern**: Clean, testable, and reusable business logic.
- **Ready-to-use UI**: Modern, responsive checkout interface.

🛠️ Installation
---------------

[](#️-installation)

1. **Install via Composer**: (Since this is currently a local package, you would typically add it to your `repositories` in `composer.json`)

    ```
    "repositories": [
        {
            "type": "path",
            "url": "../path-to-your-package"
        }
    ]
    ```

    Then run:

    ```
    composer require shaanid/paypal-package
    ```
2. **Publish Configuration and Views**:

    ```
    php artisan vendor:publish --provider="Shaanid\PayPal\PayPalServiceProvider"
    ```
3. **Environment Configuration**: Add your PayPal credentials to your `.env` file:

    ```
    PAYPAL_MODE=sandbox
    PAYPAL_SANDBOX_CLIENT_ID=your_client_id
    PAYPAL_SANDBOX_CLIENT_SECRET=your_client_secret
    PAYPAL_CURRENCY=USD
    ```
4. **Run Migrations**:

    ```
    php artisan migrate
    ```

📁 Usage
-------

[](#-usage)

The package automatically registers the following routes:

- `GET /paypal`: The checkout index page.
- `POST /paypal/process`: Handles order creation and redirection to PayPal.
- `GET /paypal/success`: Handles successful payment capture.
- `GET /paypal/cancel`: Handles payment cancellation.

### Overriding Logic

[](#overriding-logic)

You can use the Actions and Services provided by the package in your own controllers:

```
use Shaanid\PayPal\Actions\CreatePayPalOrderAction;
use Shaanid\PayPal\DTOs\PaymentData;

public function checkout(CreatePayPalOrderAction $action)
{
    $data = new PaymentData(amount: '20.00', currency: 'USD', userId: auth()->id());
    $approvalLink = $action->execute($data->toCollection());

    return redirect()->away($approvalLink);
}
```

📝 License
---------

[](#-license)

This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance81

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98845a1639425fb6a4fea5a2c63ef0c21e199585c249b5f4b6a7e7455997896e?d=identicon)[shaanid](/maintainers/shaanid)

---

Top Contributors

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

---

Tags

laravelpaymentpaypal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shaanid-paypal-package/health.svg)

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

###  Alternatives

[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

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