29 lines
889 B
PHP
29 lines
889 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Payment\Events;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Modules\Core\Payment\DTOs\PaymentResult;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Dispatched when SupportsPay::pay() or SupportsCaptures::capture() (or a
|
||
|
|
* HandlesPaymentCallback::handleCallback() resolving either later) fails
|
||
|
|
* to take the money — whether that's a sale-mode gateway declining the
|
||
|
|
* charge outright, or a capture call against an existing authorization
|
||
|
|
* being rejected. Same terminal-event symmetry as PaymentCaptured: this is
|
||
|
|
* the one "capture attempt failed" event regardless of which path
|
||
|
|
* produced it.
|
||
|
|
*/
|
||
|
|
class PaymentCaptureFailed
|
||
|
|
{
|
||
|
|
use Dispatchable;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param array<string, mixed> $context
|
||
|
|
*/
|
||
|
|
public function __construct(
|
||
|
|
public readonly string $type,
|
||
|
|
public readonly PaymentResult $result,
|
||
|
|
public readonly array $context = [],
|
||
|
|
) {}
|
||
|
|
}
|