Feat: Payment Restructuring to be fully event-driven

This commit is contained in:
arvanitakis committed 2026-09-03 17:00:24 +03:00
1 parent a987a2d57c
commit 35c3334690
13 files changed
+698 -185

No files matched your search

+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;
}