1. Go to this page and download the library: Download perkamo/symfony-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Perkamo\Client;
use Perkamo\EventInput;
final class CheckoutEvents
{
public function __construct(private readonly Client $perkamo)
{
}
public function completed(string $customerId, string $orderId): void
{
$event = EventInput::create($customerId, 'purchase.completed')
->withTransactionId($orderId)
->withContextValue('order_id', $orderId);
$this->perkamo->emitEvent($event);
}
}