File Manager / wp-content Search Upload New Item Settings File "db5.php" Full path: /home1/epichome/public_html/wp-content/db5.php File size: 60.67 B (60.67 KB bytes) MIME-type: text/x-php Charset: utf-8 Download Open Edit Advanced Editor Back
/home/pabloaso/public_html/wp-content/plugins/woocommerce-mercadopago/src/Helpers/Gateways.php
<?php

namespace MercadoPago\Woocommerce\Helpers;

use MercadoPago\Woocommerce\Configs\Store;

if (!defined('ABSPATH')) {
    exit;
}

class Gateways
{
    private Store $store;

    /**
     * Gateways constructor
     *
     * @param Store $store
     */
    public function __construct(Store $store)
    {
        $this->store     = $store;
    }

    /**
     * Determines if there are currently enabled payment gateways
     *
     * @return array
     */
    public function getEnabledPaymentGateways(): array
    {
        $enabledPaymentGateways = array();
        $paymentGateways = $this->store->getAvailablePaymentGateways();
        foreach ($paymentGateways as $gateway) {
            $gateway = new $gateway();

            if (isset($gateway->settings['enabled']) && 'yes' === $gateway->settings['enabled']) {
                $enabledPaymentGateways[] = $gateway->id;
            }
        }

        return $enabledPaymentGateways;
    }
}