PHPackages                             devmatchable/whop-symfony-bundle - 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. devmatchable/whop-symfony-bundle

ActiveSymfony-bundle[Payment Processing](/categories/payments)

devmatchable/whop-symfony-bundle
================================

Symfony bundle for the Whop PHP SDK — autowired client, webhook verification, and an overridable webhook controller.

0.0.1(3w ago)00MITPHPPHP ^8.4CI passing

Since May 15Pushed 3w agoCompare

[ Source](https://github.com/devmatchable/whop-symfony-bundle)[ Packagist](https://packagist.org/packages/devmatchable/whop-symfony-bundle)[ RSS](/packages/devmatchable-whop-symfony-bundle/feed)WikiDiscussions master Synced 1w ago

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

Whop Symfony Bundle
===================

[](#whop-symfony-bundle)

[![CI](https://github.com/devmatchable/whop-symfony-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/devmatchable/whop-symfony-bundle/actions/workflows/ci.yml)[![PHP](https://camo.githubusercontent.com/270717987f5341772d79b57567226e54ed27b2d4199bbdc98a96e2edf24902fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![PHPStan](https://camo.githubusercontent.com/6966d12e938c8e61d8f3f99cd5a10aed280cc888326354a93205ab490748870b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532306d61782d326136343936)](https://phpstan.org/)

Warning

**This package is in active development and is not yet ready for production use.**The public API may change at any time before version `1.0.0` is released. Please do not depend on it in production projects until a stable release is published.

Symfony bundle for the [Whop PHP SDK](https://github.com/devmatchable/whop-php-sdk) — autowires the `WhopApiClient` and `WebhookVerifier` from configuration and ships an overridable, bundle-owned webhook controller.

Requirements
------------

[](#requirements)

- PHP 8.4+
- Symfony 7

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

[](#installation)

```
composer require devmatchable/whop-symfony-bundle
```

If [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) is installed, the recipe registers the bundle, drops the config and route files, and appends the required environment variables automatically. Otherwise, follow the manual setup below.

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

[](#configuration)

The bundle is configured under the `whop` key, conventionally in `config/packages/whop.yaml`:

```
whop:
    api_key:        '%env(WHOP_API_KEY)%'           # required
    webhook_secret: '%env(WHOP_WEBHOOK_SECRET)%'    # required
    base_url:       'https://api.whop.com/api/v1'   # optional, default shown
    http_client:    null                           # optional, default shown
    webhook_path:   '/_whop/webhook'                # optional, default shown
```

- **`api_key`** *(required)* — the Whop API key (Bearer token) the `WhopApiClient`authenticates with.
- **`webhook_secret`** *(required)* — the Standard Webhooks signing secret the `WebhookVerifier` checks incoming webhooks against. Supports both `whsec_`(production) and `ws_` (sandbox) secret formats.
- **`base_url`** *(optional)* — the Whop API base URL. Override with the sandbox URL (`https://sandbox-api.whop.com/api/v1`) for non-production environments.
- **`http_client`** *(optional)* — the service id of a PSR-18 / Symfony HTTP client to use for outbound API calls. When `null`, the bundle uses the default Symfony HTTP client.
- **`webhook_path`** *(optional)* — the path the bundle's webhook route is mounted at. Point your Whop webhook configuration at this path.

Manual setup without the Flex recipe
------------------------------------

[](#manual-setup-without-the-flex-recipe)

1. Register the bundle in `config/bundles.php`:

    ```
    return [
        // ...
        Matchable\Whop\Bundle\WhopBundle::class => ['all' => true],
    ];
    ```
2. Add `config/packages/whop.yaml` with the configuration block shown above.
3. Import the bundle's webhook route in `config/routes/whop.yaml`:

    ```
    # config/routes/whop.yaml
    whop:
        resource: '@WhopBundle/config/routes.php'
    ```

Usage — the API client
----------------------

[](#usage--the-api-client)

The SDK's `WhopApiClient` is registered as an autowired service. Type-hint it in any service constructor:

```
use Matchable\Whop\WhopApiClient;

final readonly class PaymentLookup
{
    public function __construct(
        private WhopApiClient $whop,
    ) {
    }

    public function fetch(string $paymentId): void
    {
        $payment = $this->whop->payments->get($paymentId);
        // ...
    }
}
```

The `WebhookVerifier` is autowired the same way if you need to verify webhooks outside the bundle's controller.

Usage — webhooks
----------------

[](#usage--webhooks)

Point your Whop webhook configuration at the bundle's webhook path (default `/_whop/webhook`). The bundle-owned controller verifies the Standard Webhooks signature, decodes the JSON body, and hands off to a `WhopWebhookHandlerInterface`. The default handler dispatches a `WhopWebhookReceivedEvent`, so zero-config works: just subscribe to the event.

```
use Matchable\Whop\Bundle\Event\WhopWebhookReceivedEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;

#[AsEventListener]
final class WhopWebhookListener
{
    public function __invoke(WhopWebhookReceivedEvent $event): void
    {
        // $event->payload    — decoded webhook JSON (array)
        // $event->rawPayload — the verified raw request body
    }
}
```

The controller responds with `204 No Content` on success, `401 Unauthorized` on an invalid signature, and `400 Bad Request` on a body that is not decodable JSON.

Overriding webhook handling
---------------------------

[](#overriding-webhook-handling)

The webhook handler is overridable with standard Symfony service configuration — no compiler pass, no tag. Three documented paths:

1. **Implement the interface** and alias `WhopWebhookHandlerInterface` to your service:

    ```
    # config/services.yaml
    services:
        App\Whop\MyWebhookHandler: ~

        Matchable\Whop\Bundle\Webhook\WhopWebhookHandlerInterface:
            alias: App\Whop\MyWebhookHandler
    ```
2. **Extend** `EventDispatchingWebhookHandler` and override `handle()`.
3. **Decorate** the default handler with `#[AsDecorator]` to wrap it (e.g. log, then delegate to the inner handler).

A note on DTOs
--------------

[](#a-note-on-dtos)

The SDK's DTOs (`Payment`, `WebhookResponse`, etc.) are sealed boundary types, and the SDK has no DTO for *incoming* webhook event payloads — `WebhookResponse` models the response from *creating* a webhook registration, not an event body. The handler therefore receives the decoded `array $payload`. Map it to your own domain type inside your listener or handler.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99ca2da4eb72149536aad21d87b92c24240bfffea7d702c01bd705b138fa47ad?d=identicon)[ToluTourialai](/maintainers/ToluTourialai)

![](https://www.gravatar.com/avatar/046ec11941ea4d874be32d3e03e97c5c13a9ce951594fd02dfc67792d0742a84?d=identicon)[JeroenMoonen](/maintainers/JeroenMoonen)

---

Top Contributors

[![Bakhtarian](https://avatars.githubusercontent.com/u/14197470?v=4)](https://github.com/Bakhtarian "Bakhtarian (24 commits)")

---

Tags

api-clientbundlepaymentsphppsr-18symfonysymfony-bundlewebhookwhopwhop-apisymfonybundlepaymentswebhookwhop

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/devmatchable-whop-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/devmatchable-whop-symfony-bundle/health.svg)](https://phpackages.com/packages/devmatchable-whop-symfony-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k246.0M11.0k](/packages/symfony-framework-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[shopware/storefront

Storefront for Shopware

684.4M207](/packages/shopware-storefront)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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