Feature: Abstraction on Payments based on their operations
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Payment\Contracts;
|
||||
|
||||
use Modules\Core\Payment\DTOs\PaymentResult;
|
||||
|
||||
/**
|
||||
* Cancels a PRIOR SupportsAuthorization::authorize() hold WITHOUT
|
||||
* settling it — the "actually, never mind" exit SupportsCaptures::capture()
|
||||
* doesn't take. No funds ever moved, so this is not a refund: there is
|
||||
* nothing to give back, only a hold to release early (rather than letting
|
||||
* it simply expire on its own).
|
||||
*
|
||||
* Dispatches Modules\Core\Payment\Events\PaymentVoided or
|
||||
* PaymentVoidFailed.
|
||||
*/
|
||||
interface SupportsVoids
|
||||
{
|
||||
/**
|
||||
* $reference is the identifier SupportsAuthorization::authorize()
|
||||
* returned for the hold being released.
|
||||
*
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function void(string $reference, array $context = []): PaymentResult;
|
||||
}
|
||||
Reference in New Issue
Block a user