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
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace Modules\Core\Payment\Contracts;
use Lunar\Models\Order;
use Modules\Core\Payment\DataTransferObjects\RefundResult;
/**
* Optional capability for payment drivers whose gateway supports refunding
* a prior charge. Drivers without a refund API (or that never got that far
* — e.g. an offline/manual driver) simply don't implement it. Mirrors
* Shipping\Contracts\SupportsTracking's opt-in shape.
*/
interface SupportsRefunds
{
/**
* $reference is the gateway's own identifier for the charge being
* refunded (e.g. a Viva Wallet transaction id) — not a Lunar
* Transaction model, since not every gateway's refund flow maps
* cleanly onto one. $amount is in the currency's minor unit, same
* convention as Lunar\Base\Casts\Price.
*/
public function refund(Order $order, string $reference, int $amount, ?string $notes = null): RefundResult;
}