Feat: Payment Restructuring to be fully event-driven
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Modules\Core\Payment\Contracts;
|
||||
|
||||
use Lunar\DataTypes\Price;
|
||||
use Modules\Core\Payment\DTOs\PaymentResult;
|
||||
|
||||
/**
|
||||
@@ -20,7 +21,15 @@ interface SupportsVoids
|
||||
* $reference is the identifier SupportsAuthorization::authorize()
|
||||
* returned for the hold being released.
|
||||
*
|
||||
* $amount is the authorized amount being released — Lunar's own
|
||||
* Price, same as every other Payment contract method (see
|
||||
* PaymentResult's own docblock). Required explicitly: the caller
|
||||
* (whatever placed the original authorize() call) already knows it,
|
||||
* same reasoning as SupportsCaptures::capture()'s own $amount — a
|
||||
* driver shouldn't need a live gateway lookup just to know what it's
|
||||
* releasing.
|
||||
*
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function void(string $reference, array $context = []): PaymentResult;
|
||||
}
|
||||
public function void(string $reference, Price $amount, array $context = []): PaymentResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user