<?php
/**
 * Payment Gateway Interface
 *
 * @package NemtlyBooking
 */

namespace NemtlyBooking\Interfaces;

/**
 * Interface Payment_Gateway_Interface
 */
interface Payment_Gateway_Interface {
    /**
     * Get gateway ID
     *
     * @return string
     */
    public function get_id();

    /**
     * Get gateway name
     *
     * @return string
     */
    public function get_name();

    /**
     * Process a payment
     *
     * @param float  $amount   Amount to charge.
     * @param string $currency Currency code.
     * @param array  $metadata Additional metadata (e.g. booking_id).
     *
     * @return array Result with 'success', 'transaction_id', 'message'.
     */
    public function process_payment( $amount, $currency, $metadata = [] );

    /**
     * Refund a payment
     *
     * @param string $transaction_id Transaction ID.
     * @param float  $amount         Amount to refund (null for full refund).
     *
     * @return bool True on success.
     */
    public function refund_payment( $transaction_id, $amount = null );

    /**
     * Create a payment intent (for frontend JS SDKs)
     *
     * @param float  $amount   Amount.
     * @param string $currency Currency.
     * @param array  $metadata Metadata.
     *
     * @return string Client secret.
     */
    public function create_payment_intent( $amount, $currency, $metadata = [] );

    /**
     * Verify webhook signature
     *
     * @param string $payload    Raw payload.
     * @param string $sig_header Signature header.
     *
     * @return mixed Event object or null if invalid.
     */
    public function verify_webhook( $payload, $sig_header );
}
