{"id":42127717,"url":"https://github.com/sudiptpa/paypal-ipn","last_synced_at":"2026-04-01T21:24:36.396Z","repository":{"id":57060983,"uuid":"77828329","full_name":"sudiptpa/paypal-ipn","owner":"sudiptpa","description":"PayPal IPN (Instant Payment Notification) handling PHP library with a modern fluent API, framework-agnostic optional transports, and support for legacy PayPal IPN, NVP, SOAP, and classic PayPal API integrations.","archived":false,"fork":false,"pushed_at":"2026-04-01T10:01:55.000Z","size":63,"stargazers_count":10,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-01T11:38:12.704Z","etag":null,"topics":["api","nvp","paypal","paypal-api","paypal-checkout","paypal-express-checkout","paypal-ipn","paypal-payment-gateway","php","soap"],"latest_commit_sha":null,"homepage":"https://sujipthapa.com/blog/paypal-ipn-handling-in-php-a-modern-framework-agnostic-approach","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudiptpa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"sudiptpa"}},"created_at":"2017-01-02T11:16:30.000Z","updated_at":"2026-04-01T10:01:59.000Z","dependencies_parsed_at":"2022-08-24T07:30:55.490Z","dependency_job_id":null,"html_url":"https://github.com/sudiptpa/paypal-ipn","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sudiptpa/paypal-ipn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-ipn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-ipn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-ipn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-ipn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudiptpa","download_url":"https://codeload.github.com/sudiptpa/paypal-ipn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudiptpa%2Fpaypal-ipn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","nvp","paypal","paypal-api","paypal-checkout","paypal-express-checkout","paypal-ipn","paypal-payment-gateway","php","soap"],"created_at":"2026-01-26T15:12:38.789Z","updated_at":"2026-04-01T21:24:36.386Z","avatar_url":"https://github.com/sudiptpa.png","language":"PHP","funding_links":["https://github.com/sponsors/sudiptpa"],"categories":[],"sub_categories":[],"readme":"# PayPal IPN\n\nFramework-agnostic, modernized PayPal IPN verification package for legacy Instant Payment Notification workflows.\n\n[![CI](https://github.com/sudiptpa/paypal-ipn/actions/workflows/ci.yml/badge.svg)](https://github.com/sudiptpa/paypal-ipn/actions/workflows/ci.yml)\n[![Packagist Version](https://img.shields.io/packagist/v/sudiptpa/paypal-ipn.svg)](https://packagist.org/packages/sudiptpa/paypal-ipn)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/sudiptpa/paypal-ipn.svg)](https://packagist.org/packages/sudiptpa/paypal-ipn)\n[![PHP Version](https://img.shields.io/badge/php-8.2--8.5-777bb4.svg)](https://www.php.net/)\n[![License](https://img.shields.io/packagist/l/sudiptpa/paypal-ipn.svg)](LICENSE)\n\n---\n\n[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-ea4aaa?logo=githubsponsors\u0026logoColor=white)](https://github.com/sponsors/sudiptpa)\n\nIf this package has been useful to you, GitHub Sponsors is a simple way to support ongoing maintenance, improvements, and future releases.\n\n## Why This Package\n\nPayPal 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.\n\nIf you are integrating today, prefer the modern `Ipn` entry point. Keep the legacy handler flow when you want minimal application changes during upgrades.\n\n## Highlights\n\n- preferred modern fluent usage with `Sujip\\PayPal\\Notification\\Ipn`\n- stable legacy-style usage with `ArrayHandler` and `StreamHandler`\n- zero hard runtime dependencies beyond PHP\n- no hard Guzzle dependency\n- no hard Symfony dependency\n- built-in lightweight event dispatcher\n- built-in cURL transport when `ext-curl` is available\n- optional Guzzle transport support\n- custom transport and custom dispatcher support\n- PHP `8.2` to `\u003c8.6`\n\n## Installation\n\n```bash\ncomposer require sudiptpa/paypal-ipn\n```\n\nOptional Guzzle usage:\n\n```bash\ncomposer require guzzlehttp/guzzle\n```\n\n## Documentation\n\n- [User Guide](docs/user-guide.md)\n- [Migration Guide](docs/migration-guide.md)\n- [Architecture](ARCHITECTURE.md)\n- [cURL Transport](docs/transports/curl.md)\n- [Guzzle Transport](docs/transports/guzzle.md)\n- [Custom Transport](docs/transports/custom.md)\n- [Contributing](CONTRIBUTING.md)\n- [Security](SECURITY.md)\n\n## Looking For A Modern Unified PayPal Package?\n\nIf you are starting a new integration or want one modern package for both legacy IPN and PayPal Webhooks, use [`sudiptpa/paypal-notifications`](https://github.com/sudiptpa/paypal-notifications).\n\nUse this package when:\n\n- you want a focused IPN-only package\n- you need to modernize an existing IPN integration with minimal behavioral change\n\nUse `paypal-notifications` when:\n\n- you want support for both PayPal IPN and Webhooks\n- you are building a newer integration around the modern PayPal notification model\n- you want one package to handle legacy and newer notification flows together\n\n## Recommended Usage\n\nFor new integrations and most upgrades, prefer the modern fluent API:\n\n```php\nuse Sujip\\PayPal\\Notification\\Ipn;\n\n$result = Ipn::fromArray($_POST)\n    -\u003esandbox()\n    -\u003everify();\n```\n\nYou can still attach listeners, custom transports, and dispatchers as needed.\n\n## Quick Start\n\n### Modern Fluent Usage\n\n```php\nuse Sujip\\PayPal\\Notification\\Events\\Failure;\nuse Sujip\\PayPal\\Notification\\Events\\Invalid;\nuse Sujip\\PayPal\\Notification\\Events\\Verified;\nuse Sujip\\PayPal\\Notification\\Ipn;\n\n$result = Ipn::fromArray($_POST)\n    -\u003esandbox()\n    -\u003eonVerified(function (Verified $event): void {\n        $payload = $event-\u003egetPayload();\n\n        // Process the verified PayPal IPN here.\n    })\n    -\u003eonInvalid(function (Invalid $event): void {\n        $payload = $event-\u003egetPayload();\n\n        // Log the invalid payload here.\n    })\n    -\u003eonError(function (Failure $event): void {\n        $error = $event-\u003eerror();\n\n        // Log transport or verification errors here.\n    })\n    -\u003everify();\n```\n\n### Legacy Listener Usage\n\n```php\nuse Sujip\\PayPal\\Notification\\Events\\Failure;\nuse Sujip\\PayPal\\Notification\\Events\\Invalid;\nuse Sujip\\PayPal\\Notification\\Events\\Verified;\nuse Sujip\\PayPal\\Notification\\Handler\\ArrayHandler;\n\n$manager = (new ArrayHandler($_POST))\n    -\u003esandbox()\n    -\u003ehandle();\n\n$manager-\u003eonVerified(function (Verified $event): void {\n    $payload = $event-\u003egetPayload();\n\n    // Process the verified PayPal IPN here.\n});\n\n$manager-\u003eonInvalid(function (Invalid $event): void {\n    $payload = $event-\u003egetPayload();\n\n    // Log the invalid payload here.\n});\n\n$manager-\u003eonError(function (Failure $event): void {\n    $error = $event-\u003eerror();\n\n    // Log transport or verification errors here.\n});\n\n$manager-\u003efire();\n```\n\n## Public API Stability\n\nThe package is intentionally conservative about the legacy integration shape. These areas should be treated as public API for consumers:\n\n- `Sujip\\PayPal\\Notification\\Ipn`\n- `Sujip\\PayPal\\Notification\\Handler\\ArrayHandler`\n- `Sujip\\PayPal\\Notification\\Handler\\StreamHandler`\n- `Sujip\\PayPal\\Notification\\Manager`\n- verification events\n- `Sujip\\PayPal\\Notification\\Contracts\\Service`\n- listener methods and event names\n\nInternal implementation classes may evolve over time, especially where compatibility wrappers exist to preserve user-facing behavior.\n\n## Transport Resolution\n\nThe package resolves verification transports in this order:\n\n1. a custom service passed via `-\u003eusing()`\n2. a transport or Guzzle client passed via `-\u003ewithTransport()` or `-\u003ewithClient()`\n3. the built-in cURL transport when `ext-curl` is available\n4. the optional Guzzle transport when Guzzle is installed\n\nIf none of those are available, the verification cycle fails with a clear transport exception.\n\n## Backward Compatibility\n\nThe legacy listener-driven flow is intentionally preserved, but it is now the compatibility path rather than the recommended starting point:\n\n```php\n$manager = (new ArrayHandler($payload))-\u003esandbox()-\u003ehandle();\n$manager-\u003eonVerified(fn ($event) =\u003e null);\n$manager-\u003eonInvalid(fn ($event) =\u003e null);\n$manager-\u003eonError(fn ($event) =\u003e null);\n$manager-\u003efire();\n```\n\nThere is also a modern fluent entry point with the same verification engine underneath:\n\n```php\nIpn::fromArray($payload)\n    -\u003esandbox()\n    -\u003eonVerified(fn ($event) =\u003e null)\n    -\u003everify();\n```\n\nThat means users can upgrade the package internals without needing a functionality rewrite in their applications, while newer integrations can adopt a cleaner API.\n\n## Extendability\n\n### Custom transport\n\nImplement `Sujip\\PayPal\\Notification\\Contracts\\Service` and pass it to `-\u003eusing()`.\n\n### Optional Guzzle transport\n\nInstall Guzzle in your application and pass a client into `-\u003ewithClient()`.\n\n### External event dispatcher\n\nPass any compatible dispatcher object into `-\u003ewithDispatcher()` as long as it provides `addListener()` and `dispatch()` methods.\n\n## Support\n\n- use the GitHub issue tracker for bugs and regressions\n- report security issues privately using [SECURITY.md](SECURITY.md)\n- use PayPal sandbox IPN verification in your own app before deploying changes\n\n## Development\n\n```bash\ncomposer lint\ncomposer stan\ncomposer rector:check\ncomposer test\ncomposer test:coverage\n```\n\n## Testing Strategy\n\nThe test suite covers:\n\n- endpoint switching between live and sandbox\n- payload parsing and serialization\n- verified, invalid, and failure event dispatching\n- custom service injection\n- local dispatcher behavior and external dispatcher interoperability\n- legacy and modern public usage styles\n- request transport validation behavior\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudiptpa%2Fpaypal-ipn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudiptpa%2Fpaypal-ipn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudiptpa%2Fpaypal-ipn/lists"}