53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use App\Models\Payment\Transaction;
|
|
use App\Models\Shop\Order;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class OrderIsRefunded
|
|
{
|
|
use Dispatchable;
|
|
use SerializesModels;
|
|
|
|
/** @var \App\Models\Shop\Order */
|
|
private $order;
|
|
|
|
/** @var \App\Models\Payment\Transaction */
|
|
private $transaction;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param \App\Models\Shop\Order $order The order to refund.
|
|
* @param \App\Models\Payment\Transaction $transaction The transaction concerned by the refund.
|
|
* @return void
|
|
*/
|
|
public function __construct(Order $order, Transaction $transaction)
|
|
{
|
|
$this->order = $order;
|
|
$this->transaction = $transaction;
|
|
}
|
|
|
|
/**
|
|
* Get Event order
|
|
*
|
|
* @return \App\Models\Shop\Order
|
|
*/
|
|
public function getOrder(): Order
|
|
{
|
|
return $this->order;
|
|
}
|
|
|
|
/**
|
|
* Get Event transaction
|
|
*
|
|
* @return \App\Models\Payment\Transaction
|
|
*/
|
|
public function getTransaction(): Transaction
|
|
{
|
|
return $this->transaction;
|
|
}
|
|
}
|