Feature: Abstraction on Payments based on their operations
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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 = [],
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user