<?php
/**
 * Interface for Flo WC Payment Gateways.
 *
 * @package flo-checkout
 */

namespace Flo_Checkout\Gateways\Helpers;

use Exception;
use Northmill_Online_Shared_Checkout\Northmill_Online_Shared\Modules\Loggers\Log_Level_Enum;

defined( 'ABSPATH' ) || exit;

/**
 * Interface Interface_Flo_WC_Payment_Gateway
 */
interface Interface_Flo_WC_Payment_Gateway {

	/**
	 * Get Gateway ID.
	 *
	 * @return string
	 */
	public static function get_id(): string;

	/**
	 * Whether the gateway supports blocks.
	 *
	 * @return bool
	 */
	public static function has_block_support(): bool;

	/**
	 * Public setup.
	 *
	 * @return void
	 */
	public static function public_setup(): void;

	/**
	 * Logs a message.
	 *
	 * @param string         $message The message to log.
	 * @param array          $context The context to log.
	 * @param Log_Level_Enum $level The log level.
	 */
	public function log( string $message, array $context, Log_Level_Enum $level = Log_Level_Enum::DEBUG );

	/**
	 * Throw and log an error.
	 *
	 * @param string         $front_end_message The message to show to the user.
	 * @param array|null     $context           The context to log.
	 * @param string|null    $back_end_message  The message to log. Defaults to the front end message.
	 * @param Log_Level_Enum $log_level         Log level.
	 *
	 * @throws Exception The error.
	 */
	public function log_and_throw_error(
		string $front_end_message,
		?array $context = null,
		?string $back_end_message = null,
		Log_Level_Enum $log_level = Log_Level_Enum::ERROR
	);
}
