<?php

namespace Sipago\WooCommerce\SipagoCheckout\Helpers;

use WC_Gateway_Sipago_Sipago_REST;

class PluginInfoHelper
{
    public static function getInfo()
    {
        global $sipagoPluginData;
        $sipagopayPlus = new WC_Gateway_Sipago_Sipago_REST();
        $sipagopayPlusEnvironment = $sipagopayPlus->get_option('sipago_pay_environment');
  

        if ($sipagoPluginData) {
            $pluginVersion = $sipagoPluginData['Version'] ?? '0';
        }

        return [
            'plugin'            => 'wc',
            'version'           => $pluginVersion ?? null,
            'wpenv'             => $sipagopayPlusEnvironment
        ];
    }

    public static function printImage($source = null)
    {
        $trackinfo = static::getInfo();
        if ($source) {
            $trackinfo['source'] = $source;
        } ?>
        <?php
    }
}
