24 lines
821 B
PHP
24 lines
821 B
PHP
<?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;
|
||
|
|
}
|