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 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 = [],
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user