27 lines
766 B
PHP
27 lines
766 B
PHP
<?php
|
|
|
|
namespace Modules\Core\Payment\Events;
|
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Modules\Core\Payment\DTOs\PaymentResult;
|
|
|
|
/**
|
|
* Dispatched by SupportsRefunds::refund() once settled funds (from a prior
|
|
* pay() or capture()) have actually been returned — full or partial.
|
|
* Independent of whether the original settlement was a sale or an
|
|
* authorize-then-capture: a refund only ever targets money that was
|
|
* genuinely taken, regardless of how it got taken.
|
|
*/
|
|
class PaymentRefunded
|
|
{
|
|
use Dispatchable;
|
|
|
|
/**
|
|
* @param array<string, mixed> $context
|
|
*/
|
|
public function __construct(
|
|
public readonly string $type,
|
|
public readonly PaymentResult $result,
|
|
public readonly array $context = [],
|
|
) {}
|
|
} |