PHPackages                             sudiptpa/paypal-ipn - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. sudiptpa/paypal-ipn

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

sudiptpa/paypal-ipn
===================

Modernized, framework-agnostic PayPal IPN verification package for legacy IPN workflows.

v3.0.0(1mo ago)1020.9k10MITPHPPHP &gt;=8.2 &lt;8.6CI passing

Since Jan 2Pushed 1mo ago1 watchersCompare

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

READMEChangelog (3)Dependencies (6)Versions (7)Used By (0)

PayPal IPN
==========

[](#paypal-ipn)

Framework-agnostic, modernized PayPal IPN verification package for legacy Instant Payment Notification workflows.

[![CI](https://github.com/sudiptpa/paypal-ipn/actions/workflows/ci.yml/badge.svg)](https://github.com/sudiptpa/paypal-ipn/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/095c3b371a86bc0475a5afd4b13c7f7ad6d259ac35c1b0a160110bab08985678/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756469707470612f70617970616c2d69706e2e737667)](https://packagist.org/packages/sudiptpa/paypal-ipn)[![Packagist Downloads](https://camo.githubusercontent.com/f5590e2e5b3d18fd7ea10e55bc48f5e108ec5a64b6dc57fcdba1c8a2b8173ae6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756469707470612f70617970616c2d69706e2e737667)](https://packagist.org/packages/sudiptpa/paypal-ipn)[![PHP Version](https://camo.githubusercontent.com/1aa7939e7a27a6dfba78b11869a5918ecc8c2da1876f0122727733776e3fff4c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322d2d382e352d3737376262342e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/5adea18143af5cebf24c803a2b52b6684a870710f33d68523a3e1f85b88a7346/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73756469707470612f70617970616c2d69706e2e737667)](LICENSE)

Why This Package
----------------

[](#why-this-package)

PayPal IPN is legacy, but thousands of projects still depend on it. This package now gives you a modern fluent API for new work while still preserving the familiar listener flow that existing integrations already use.

If you are integrating today, prefer the modern `Ipn` entry point. Keep the legacy handler flow when you want minimal application changes during upgrades.

Highlights
----------

[](#highlights)

- preferred modern fluent usage with `Sujip\PayPal\Notification\Ipn`
- stable legacy-style usage with `ArrayHandler` and `StreamHandler`
- zero hard runtime dependencies beyond PHP
- no hard Guzzle dependency
- no hard Symfony dependency
- built-in lightweight event dispatcher
- built-in cURL transport when `ext-curl` is available
- optional Guzzle transport support
- custom transport and custom dispatcher support
- PHP `8.2` to `sandbox()
    ->verify();
```

You can still attach listeners, custom transports, and dispatchers as needed.

Quick Start
-----------

[](#quick-start)

### Modern Fluent Usage

[](#modern-fluent-usage)

```
use Sujip\PayPal\Notification\Events\Failure;
use Sujip\PayPal\Notification\Events\Invalid;
use Sujip\PayPal\Notification\Events\Verified;
use Sujip\PayPal\Notification\Ipn;

$result = Ipn::fromArray($_POST)
    ->sandbox()
    ->onVerified(function (Verified $event): void {
        $payload = $event->getPayload();

        // Process the verified PayPal IPN here.
    })
    ->onInvalid(function (Invalid $event): void {
        $payload = $event->getPayload();

        // Log the invalid payload here.
    })
    ->onError(function (Failure $event): void {
        $error = $event->error();

        // Log transport or verification errors here.
    })
    ->verify();
```

### Legacy Listener Usage

[](#legacy-listener-usage)

```
use Sujip\PayPal\Notification\Events\Failure;
use Sujip\PayPal\Notification\Events\Invalid;
use Sujip\PayPal\Notification\Events\Verified;
use Sujip\PayPal\Notification\Handler\ArrayHandler;

$manager = (new ArrayHandler($_POST))
    ->sandbox()
    ->handle();

$manager->onVerified(function (Verified $event): void {
    $payload = $event->getPayload();

    // Process the verified PayPal IPN here.
});

$manager->onInvalid(function (Invalid $event): void {
    $payload = $event->getPayload();

    // Log the invalid payload here.
});

$manager->onError(function (Failure $event): void {
    $error = $event->error();

    // Log transport or verification errors here.
});

$manager->fire();
```

Public API Stability
--------------------

[](#public-api-stability)

The package is intentionally conservative about the legacy integration shape. These areas should be treated as public API for consumers:

- `Sujip\PayPal\Notification\Ipn`
- `Sujip\PayPal\Notification\Handler\ArrayHandler`
- `Sujip\PayPal\Notification\Handler\StreamHandler`
- `Sujip\PayPal\Notification\Manager`
- verification events
- `Sujip\PayPal\Notification\Contracts\Service`
- listener methods and event names

Internal implementation classes may evolve over time, especially where compatibility wrappers exist to preserve user-facing behavior.

Transport Resolution
--------------------

[](#transport-resolution)

The package resolves verification transports in this order:

1. a custom service passed via `->using()`
2. a transport or Guzzle client passed via `->withTransport()` or `->withClient()`
3. the built-in cURL transport when `ext-curl` is available
4. the optional Guzzle transport when Guzzle is installed

If none of those are available, the verification cycle fails with a clear transport exception.

Backward Compatibility
----------------------

[](#backward-compatibility)

The legacy listener-driven flow is intentionally preserved, but it is now the compatibility path rather than the recommended starting point:

```
$manager = (new ArrayHandler($payload))->sandbox()->handle();
$manager->onVerified(fn ($event) => null);
$manager->onInvalid(fn ($event) => null);
$manager->onError(fn ($event) => null);
$manager->fire();
```

There is also a modern fluent entry point with the same verification engine underneath:

```
Ipn::fromArray($payload)
    ->sandbox()
    ->onVerified(fn ($event) => null)
    ->verify();
```

That means users can upgrade the package internals without needing a functionality rewrite in their applications, while newer integrations can adopt a cleaner API.

Extendability
-------------

[](#extendability)

### Custom transport

[](#custom-transport)

Implement `Sujip\PayPal\Notification\Contracts\Service` and pass it to `->using()`.

### Optional Guzzle transport

[](#optional-guzzle-transport)

Install Guzzle in your application and pass a client into `->withClient()`.

### External event dispatcher

[](#external-event-dispatcher)

Pass any compatible dispatcher object into `->withDispatcher()` as long as it provides `addListener()` and `dispatch()` methods.

Support
-------

[](#support)

- use the GitHub issue tracker for bugs and regressions
- report security issues privately using [SECURITY.md](SECURITY.md)
- use PayPal sandbox IPN verification in your own app before deploying changes

Development
-----------

[](#development)

```
composer lint
composer stan
composer rector:check
composer test
composer test:coverage
```

Testing Strategy
----------------

[](#testing-strategy)

The test suite covers:

- endpoint switching between live and sandbox
- payload parsing and serialization
- verified, invalid, and failure event dispatching
- custom service injection
- local dispatcher behavior and external dispatcher interoperability
- legacy and modern public usage styles
- request transport validation behavior

License
-------

[](#license)

MIT

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Total

5

Last Release

52d ago

Major Versions

1.0.x-dev → 2.0.02017-01-02

v2.0.1 → v3.0.02026-03-21

PHP version history (3 changes)1.0.1PHP &gt;=5.5

v2.0.1PHP ~5.5|~7.0

v3.0.0PHP &gt;=8.2 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/89a8c4cc02c4a958a03c60826c3d24b9dcbade10d3439e60e266702dbacc61e4?d=identicon)[sudiptpa](/maintainers/sudiptpa)

---

Top Contributors

[![sudiptpa](https://avatars.githubusercontent.com/u/7222620?v=4)](https://github.com/sudiptpa "sudiptpa (48 commits)")

---

Tags

apinvppaypalpaypal-apipaypal-checkoutpaypal-express-checkoutpaypal-ipnpaypal-payment-gatewayphpsoapnotificationpaypalipnlegacy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sudiptpa-paypal-ipn/health.svg)

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

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[edujugon/push-notification

Laravel Package to send push notifications to Android and IOS devices. (GCM,FCM,APN)

4891.4M1](/packages/edujugon-push-notification)[bentools/webpush-bundle

Send push notifications through Web Push Protocol to your Symfony users.

71274.3k](/packages/bentools-webpush-bundle)[mike182uk/paypal-ipn-listener

A PayPal IPN (Instant Payment Notification) listener for PHP

90555.4k6](/packages/mike182uk-paypal-ipn-listener)

PHPackages © 2026

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