PHP code example of perkamo / symfony-bundle

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/ */

    

perkamo / symfony-bundle example snippets


return [
    Perkamo\SymfonyBundle\PerkamoSymfonyBundle::class => ['all' => true],
];

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);
    }
}

$perkamo->identify($customerId, [
    'email' => $customerEmail,
    'name' => $customerName,
]);

$events = $perkamo->eventCatalog();
yaml
# config/routes/perkamo.yaml
perkamo:
  resource: "@PerkamoSymfonyBundle/config/routes.php"
  type: php
twig
{{ perkamo_browser_bundle_script(asset("build/perkamo-browser.global.min.js")) }}