<?php

namespace App\Payment\Gateway;

interface PaymentGatewayInterface
{
    public function getName(): string;

    /**
     * Whether this gateway has valid credentials configured and can be offered to users.
     */
    public function isConfigured(): bool;

    /**
     * Initiates payment, returns redirect URL or token.
     */
    public function initiate(int $amountRials, string $orderId, string $callbackUrl): PaymentInitResult;

    /**
     * Verifies callback and confirms payment.
     */
    public function verify(array $callbackData): PaymentVerifyResult;

    /**
     * Refunds a settled transaction (full or partial). Amounts in Rials.
     */
    public function refund(string $saleOrderId, string $saleReferenceId, int $refundAmountRials): PaymentRefundResult;

    /**
     * Reverses a not-yet-settled transaction.
     */
    public function reverse(string $saleOrderId, string $saleReferenceId): PaymentRefundResult;
}
