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
+7 -3
View File
@@ -2,6 +2,7 @@
namespace Modules\Core\Payment\Contracts;
use Lunar\DataTypes\Price;
use Modules\Core\Payment\DTOs\PaymentResult;
/**
@@ -22,10 +23,13 @@ interface SupportsRefunds
* SupportsCaptures::capture() call returned for the settled funds
* being refunded.
*
* $amount allows a partial refund; a gateway may allow multiple
* partial refunds against one settlement, up to its own total.
* $amount is Lunar's own Price (never a gateway's own minor-unit
* scale — see PaymentResult's docblock), allowing a partial refund; a
* gateway may allow multiple partial refunds against one settlement,
* up to its own total. Required explicitly, same reasoning as
* SupportsCaptures::capture()'s own $amount.
*
* @param array<string, mixed> $context
*/
public function refund(string $reference, int $amount, array $context = []): PaymentResult;
public function refund(string $reference, Price $amount, array $context = []): PaymentResult;
}