<?php
/**
 * Helper functions for payment gateways.
 *
 * @package flo-checkout
 */

namespace Flo_Checkout\Gateways\Helpers;

/**
 * Gateway helper functions.
 */
class Gateway_Helpers {
	/**
	 * Check if a gateway class implements the Flo interface.
	 *
	 * @param string|object $gateway_class The name of the class to check, or an instance of the class.
	 *
	 * @return bool
	 */
	public static function is_gateway_implementing_flo_interface( string|object $gateway_class ): bool {
		$class_name = is_object( $gateway_class ) ? get_class( $gateway_class ) : $gateway_class;
		$interfaces = class_implements( $class_name );

		return isset( $interfaces[ Interface_Flo_WC_Payment_Gateway::class ] );
	}
}
