Feat: Updates to Payments, Checkout Services, Payment Events

This commit is contained in:
2026-09-02 16:14:52 +03:00
parent 3497553b41
commit 8cb54e065e
18 changed files with 553 additions and 84 deletions
@@ -0,0 +1,23 @@
<?php
namespace Modules\Core\Payment\Contracts;
use Lunar\Models\Order;
use Modules\Core\Payment\DataTransferObjects\CaptureResult;
/**
* Optional capability for payment drivers whose gateway supports a
* separate authorize-then-capture step. Many redirect/wallet-style
* gateways (Viva Wallet included, for most flows) charge in full at
* checkout and never need this — SupportsRefunds is the one they're more
* likely to implement instead.
*/
interface SupportsCaptures
{
/**
* $reference is the gateway's own identifier for the authorized charge
* — see SupportsRefunds::refund() for why this isn't a Lunar
* Transaction. $amount is in the currency's minor unit.
*/
public function capture(Order $order, string $reference, int $amount, ?string $notes = null): CaptureResult;
}