Feat: Payment Restructuring to be fully event-driven

This commit is contained in:
2026-09-03 17:00:24 +03:00
parent a987a2d57c
commit 35c3334690
13 changed files with 698 additions and 185 deletions
+11 -2
View File
@@ -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;
}