devmatchable/whop-symfony-bundle
Symfony 7 bundle for the Whop PHP SDK. Autowires WhopApiClient and WebhookVerifier from config, provides a ready-to-use (overridable) webhook controller/route, and supports sandbox base URL and custom HTTP client selection.
#[AsEventListener] and #[AsDecorator]. This ensures compatibility with Symfony’s latest conventions (e.g., no XML routes, PSR-18 HTTP clients).WhopWebhookReceivedEvent enables decoupled, reactive handling of webhooks, fitting Symfony’s event system. This is ideal for scalable, maintainable architectures.WebhookVerifier) simplifies secure webhook handling, reducing boilerplate for developers.devmatchable/whop-php-sdk, which is not yet on Packagist. This requires manual VCS repository configuration, adding friction for adoption.whop-php-sdk production-ready, or does it share the same pre-stable risks?HttpClient).composer require devmatchable/whop-symfony-bundle).whop.yaml and test the autowired WhopApiClient and webhook endpoint./_whop/webhook by default).WhopWebhookReceivedEvent for existing webhook logic.devmatchable/whop-php-sdk. Ensure the SDK’s API aligns with your use case (e.g., DTOs, webhook events)./_whop/webhook or custom path).whop.yaml to config/packages/ (or use Flex recipe).WHOP_API_KEY, WHOP_WEBHOOK_SECRET).WhopApiClient instantiation with type-hinted autowiring.config/routes/whop.yaml.#[AsEventListener] subscribers for WhopWebhookReceivedEvent.WhopWebhookHandlerInterface or extend EventDispatchingWebhookHandler).whop-php-sdk roadmap. Major SDK changes may require bundle updates or custom patches.whop.yaml to avoid scattered environment variables or hardcoded values.services.yaml) to simplify maintenance and onboarding.debug:container, debug:event-dispatcher) to inspect services and events.WhopWebhookReceivedEvent to track payloads, signatures, and handler outcomes. Example:
#[AsEventListener]
public function logWebhook(WhopWebhookReceivedEvent $event): void
{
$this->logger->info('Whop webhook received', [
'payload' => $event->payload,
'raw' => $event->rawPayload,
]);
}
WhopApiClient to intercept and log API calls.#[AsAsync] or Symfony Messenger).WhopApiClient uses Symfony’s HTTP client, which supports async requests. For high concurrency:
pool middleware).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Invalid webhook signature | 401 Unauthorized; missed events |
Ensure WHOP_WEBHOOK_SECRET is correct; log verification failures. |
| Malformed JSON payload | 400 Bad Request; event not dispatched |
Validate payload structure in custom handlers or listeners. |
| API key revoked or expired | 401 on |
How can I help you explore Laravel packages today?