26 lines
734 B
PHP
26 lines
734 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Order\Events;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Lunar\Models\Order;
|
||
|
|
use Lunar\Models\Transaction;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Dispatched by TransactionObserver::saved() whenever a successful
|
||
|
|
* type=refund Transaction row is written — every payment driver (Lunar's
|
||
|
|
* own StripePaymentType::refund(), or a future boboko-owned driver for a
|
||
|
|
* provider Lunar doesn't ship) creates a new row for each refund, so
|
||
|
|
* `created` alone (filtered to type+success) is enough here, unlike
|
||
|
|
* captures which can reuse an existing row.
|
||
|
|
*/
|
||
|
|
class OrderRefunded
|
||
|
|
{
|
||
|
|
use Dispatchable;
|
||
|
|
|
||
|
|
public function __construct(
|
||
|
|
public readonly Order $order,
|
||
|
|
public readonly Transaction $transaction,
|
||
|
|
) {}
|
||
|
|
}
|