2026-01-27 00:24:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-27 16:23:12 +00:00
|
|
|
namespace Core\Mod\Commerce\Events;
|
2026-01-27 00:24:22 +00:00
|
|
|
|
2026-01-27 16:23:12 +00:00
|
|
|
use Core\Mod\Commerce\Models\Order;
|
|
|
|
|
use Core\Mod\Commerce\Models\Payment;
|
2026-02-23 03:50:05 +00:00
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2026-01-27 00:24:22 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Event fired when an order is successfully paid.
|
|
|
|
|
*/
|
|
|
|
|
class OrderPaid
|
|
|
|
|
{
|
|
|
|
|
use Dispatchable;
|
|
|
|
|
use SerializesModels;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
public Order $order,
|
|
|
|
|
public Payment $payment
|
2026-04-25 22:55:49 +01:00
|
|
|
) {
|
|
|
|
|
$this->orderId = (int) $order->id;
|
|
|
|
|
$this->paymentId = (int) $payment->id;
|
|
|
|
|
$this->amount = (float) $payment->amount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int $orderId;
|
|
|
|
|
|
|
|
|
|
public int $paymentId;
|
|
|
|
|
|
|
|
|
|
public float $amount;
|
2026-01-27 00:24:22 +00:00
|
|
|
}
|