Feature: Abstraction on Payments based on their operations
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Payment\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Modules\Core\Payment\DTOs\PaymentResult;
|
||||
|
||||
/**
|
||||
* Dispatched by SupportsVoids::void() once a prior authorization hold has
|
||||
* been released without ever settling — the "actually, never mind" exit
|
||||
* from an authorize() that SupportsCaptures::capture() would otherwise
|
||||
* have settled. No funds ever moved, so this is distinct from
|
||||
* PaymentRefunded (which reverses money that was actually taken).
|
||||
*/
|
||||
class PaymentVoided
|
||||
{
|
||||
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