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;
|
||||
|
||||
/**
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user