Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
<?php
namespace HiEvents\Services\Domain\Payment\Stripe\EventHandlers;
use HiEvents\Exceptions\Stripe\StripeClientConfigurationException;
use HiEvents\Services\Domain\Subscription\AccountSubscriptionSyncService;
use Stripe\Exception\ApiErrorException;
use Stripe\Subscription;
class CustomerSubscriptionUpdatedHandler
{
public function __construct(
private readonly AccountSubscriptionSyncService $accountSubscriptionSyncService,
) {}
/**
* @throws ApiErrorException
* @throws StripeClientConfigurationException
*/
public function handleEvent(Subscription $subscription, ?string $connectedAccountId): void
{
if ($connectedAccountId !== null) {
return;
}
$this->accountSubscriptionSyncService->syncCustomer((string) $subscription->customer);
}
}