HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: //home/pelakir/www/wp-content/plugins/wc-digipay-plugin/wc-dp-gateway.php
<?php

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

define( 'MY_PLUGIN_VERSION', '1.0.0' );
define( 'MY_PLUGIN_FILE', __FILE__ );


function LoadDPGateway()
{

    if (!function_exists('addDPGatewayToWC') && class_exists('WC_Payment_Gateway') && !class_exists('WCDigiPay')) {

        function addDPGatewayToWC($methods)
        {
            $methods[] = 'WCDigiPay';
            return $methods;
        }
        function addDpCurrenciesToWC($currencies)
        {
            $currencies['IRR'] = __('ریال', 'woocommerce');
            $currencies['IRT'] = __('تومان', 'woocommerce');

            return $currencies;
        }
        function addDpCurrenciesSymbolsToWC($currency_symbol, $currency)
        {
            switch ($currency) {
                case 'IRR':
                    $currency_symbol = 'ریال';
                    break;
                case 'IRT':
                    $currency_symbol = 'تومان';
                    break;
            }
            return $currency_symbol;
        }

        add_filter('woocommerce_payment_gateways',          'addDPGatewayToWC');
        add_filter('woocommerce_currencies',                'addDpCurrenciesToWC');
        add_filter('woocommerce_currency_symbol',           'addDpCurrenciesSymbolsToWC', 10, 2);

        require_once ("WCDigiPay.php");
    }
}

add_action('plugins_loaded', 'LoadDPGateway', 0);