PHP code example of projektmotor / ids-sensor-bundle
1. Go to this page and download the library: Download projektmotor/ids-sensor-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 ProjektMotor\IdsSensor\Contract\SecurityRelevantBusinessEvent;
use ProjektMotor\IdsEventData\Vocabulary\Severity;
final class OrderAmountOverridden implements SecurityRelevantBusinessEvent
{
public function __construct(
private readonly int $orderId,
private readonly string $actorId,
private readonly float $newAmount,
) {
}
public function getEventName(): string { return 'order.amount_overridden'; }
public function getSeverityHint(): string { return Severity::Warning->value; }
public function getActorId(): ?string { return $this->actorId; }
public function getPayload(): array
{
return ['order_id' => $this->orderId, 'new_amount' => $this->newAmount];
}
}