Reusable Symfony bundle for MakePay payment links, customers, bookkeeping invoices, and signed webhook handling.
- Autowireable
MakePayClientusing Symfony HttpClient. - Bundle configuration for MakePay key ID, key secret, webhook secret, and base URL.
- Helpers for payment links, customers, bookkeeping invoices, and invoice payment links.
- Fixed-time
X-MakePay-Signatureverifier. - Optional webhook route/controller that dispatches a Symfony event after verification.
composer require makepay/symfony-bundleRegister the bundle if Symfony Flex does not do it automatically:
// config/bundles.php
return [
MakePay\Bundle\MakePayBundle\MakePayBundle::class => ['all' => true],
];# config/packages/make_pay.yaml
make_pay:
base_url: '%env(default:MAKEPAY_BASE_URL:https://www.makecrypto.io)%'
key_id: '%env(MAKEPAY_KEY_ID)%'
key_secret: '%env(MAKEPAY_KEY_SECRET)%'
webhook_secret: '%env(MAKEPAY_WEBHOOK_SECRET)%'use MakePay\Bundle\MakePayBundle\Client\MakePayClient;
final class BillingController
{
public function __construct(private readonly MakePayClient $makePay)
{
}
public function createLink(): array
{
return $this->makePay->createPaymentLink([
'title' => 'Pro plan',
'amount' => '49.00',
'currency' => 'USD',
'customerEmail' => 'customer@example.com',
'returnUrl' => 'https://example.com/billing/return',
'metadata' => ['account_id' => 'acct_123'],
]);
}
}Import the route:
# config/routes/make_pay.yaml
make_pay:
resource: '@MakePayBundle/config/routes.yaml'Subscribe to verified events:
use MakePay\Bundle\MakePayBundle\Event\MakePayWebhookEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener(event: MakePayWebhookEvent::NAME)]
final class MakePayWebhookListener
{
public function __invoke(MakePayWebhookEvent $event): void
{
$payload = $event->payload;
// Reconcile invoices, orders, subscriptions, or entitlements here.
}
}The bundled route listens on POST /webhooks/makepay.
composer install
composer validate --strict
vendor/bin/phpunit
php scripts/lint.php
npm run validate