!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.56 GB of 117.98 GB (24.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PaystackPayment.php (4.19 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 
App\Models\Plan;
use 
App\Models\WhatsAppNumber;
use 
App\Models\WhatsAppNumberRequest;
use 
Carbon\Carbon;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Config;
use 
Illuminate\Support\Facades\Log;
use 
Unicodeveloper\Paystack\Paystack;

class 
PaystackPayment implements PaymentInterface
{
    public 
$planReq;
    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 (!isset(
$credentials->paystack_status) || !$credentials->paystack_merchant_email || !$credentials->paystack_payment_url || !$credentials->paystack_public_key || !$credentials->paystack_secret_key || $credentials->paystack_status != 'active') {
            throw new 
\Exception(trans('Invalid Payment'));
        }
        return 
$credentials;
    }

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

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

    public function 
number_request($planReq)
    {
        
$this->numb_request $planReq;
        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()
    {
        
$paystackData $this->payStackPayment($this->planReq$this->request$this->number_request);
        if (
$paystackData) {
            
$this->redirect_url $paystackData;
            
$this->will_redirect true;
            
$this->return_view null;
        }
    }


    function 
payStackPayment($wNumber$request$numberRequest)
    {
        
$credentials json_decode(get_settings('payment_gateway'));
        
$number WhatsAppNumber::find($wNumber->id);
        
$numberReq WhatsAppNumberRequest::find($numberRequest->id);
        if (!
$numberReq || !$number || !isset($credentials->paystack_public_key) || !$credentials->paystack_secret_key || $credentials->paystack_status != 'active') {
            throw new 
\Exception(trans('layout.message.invalid_payment'));
        }


        
$url = isset($credentials->paystack_payment_url)?$credentials->paystack_payment_url:"https://api.paystack.co/transaction/initialize";
        
$fields = [
            
'email' => auth('customer')->user()->email,
            
'amount' => $number->sell_price 100,
            
'callback_url'=>route('paymentgateway::whatsapp.number.payment.paystack.process',['number_req'=>$numberReq->id,'number'=>$number->id]),
        ];
        
$fields_string http_build_query($fields);
        
//open connection
        
$ch curl_init();
        
//set the url, number of POST vars, POST data
        
curl_setopt($ch,CURLOPT_URL$url);
        
curl_setopt($ch,CURLOPT_POSTtrue);
        
curl_setopt($ch,CURLOPT_POSTFIELDS$fields_string);
        
curl_setopt($chCURLOPT_HTTPHEADER, array(
            
"Authorization: Bearer $credentials->paystack_secret_key",
            
"Cache-Control: no-cache",
        ));

        
//So that curl_exec returns the contents of the cURL; rather than echoing it
        
curl_setopt($ch,CURLOPT_RETURNTRANSFERtrue);
        
//execute post
        
$result curl_exec($ch);
        
$resultjson_decode($result);

        if (isset(
$result->data) && isset($result->data->authorization_url)){
            return 
$result->data->authorization_url;
        }else{
            throw new 
\Exception('Unauthorized payment url');
        }

    }


}

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