!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/smabpro.picotech.app/public_html/vendor/srmklive/paypal/src/Traits/   drwxr-xr-x
Free 28.52 GB of 117.98 GB (24.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Srmklive\PayPal\Traits;

use 
GuzzleHttp\Client as HttpClient;
use 
GuzzleHttp\Exception\ClientException as HttpClientException;
use 
GuzzleHttp\Utils;
use 
Psr\Http\Message\StreamInterface;
use 
RuntimeException;
use 
Srmklive\PayPal\Services\Str;

trait 
PayPalHttpClient
{
    
/**
     * Http Client class object.
     *
     * @var HttpClient
     */
    
private $client;

    
/**
     * Http Client configuration.
     *
     * @var array
     */
    
private $httpClientConfig;

    
/**
     * PayPal API Endpoint.
     *
     * @var string
     */
    
private $apiUrl;

    
/**
     * PayPal API Endpoint.
     *
     * @var string
     */
    
private $apiEndPoint;

    
/**
     * IPN notification url for PayPal.
     *
     * @var string
     */
    
private $notifyUrl;

    
/**
     * Http Client request body parameter name.
     *
     * @var string
     */
    
private $httpBodyParam;

    
/**
     * Default payment action for PayPal.
     *
     * @var string
     */
    
private $paymentAction;

    
/**
     * Default locale for PayPal.
     *
     * @var string
     */
    
private $locale;

    
/**
     * Validate SSL details when creating HTTP client.
     *
     * @var bool
     */
    
private $validateSSL;

    
/**
     * Request type.
     *
     * @var string
     */
    
protected $verb 'post';

    
/**
     * Set curl constants if not defined.
     *
     * @return void
     */
    
protected function setCurlConstants()
    {
        
$constants = [
            
'CURLOPT_SSLVERSION'        => 32,
            
'CURL_SSLVERSION_TLSv1_2'   => 6,
            
'CURLOPT_SSL_VERIFYPEER'    => 64,
            
'CURLOPT_SSLCERT'           => 10025,
        ];

        foreach (
$constants as $key => $item) {
            
$this->defineCurlConstant($key$item);
        }
    }

    
/**
     * Declare a curl constant.
     *
     * @param string $key
     * @param string $value
     *
     * @return bool
     */
    
protected function defineCurlConstant(string $keystring $value)
    {
        return 
defined($key) ? true define($key$value);
    }

    
/**
     * Function to initialize/override Http Client.
     *
     * @param \GuzzleHttp\Client|null $client
     *
     * @return void
     */
    
public function setClient(HttpClient $client null)
    {
        if (
$client instanceof HttpClient) {
            
$this->client $client;

            return;
        }

        
$this->client = new HttpClient([
            
'curl' => $this->httpClientConfig,
        ]);
    }

    
/**
     * Function to set Http Client configuration.
     *
     * @return void
     */
    
protected function setHttpClientConfiguration()
    {
        
$this->setCurlConstants();

        
$this->httpClientConfig = [
            
CURLOPT_SSLVERSION     => CURL_SSLVERSION_TLSv1_2,
            
CURLOPT_SSL_VERIFYPEER => $this->validateSSL,
        ];

        
// Initialize Http Client
        
$this->setClient();

        
// Set default values.
        
$this->setDefaultValues();

        
// Set PayPal IPN Notification URL
        
$this->notifyUrl $this->config['notify_url'];
    }

    
/**
     * Set default values for configuration.
     *
     * @return void
     */
    
private function setDefaultValues()
    {
        
$paymentAction = empty($this->paymentAction) ? 'Sale' $this->paymentAction;
        
$this->paymentAction $paymentAction;

        
$locale = empty($this->locale) ? 'en_US' $this->locale;
        
$this->locale $locale;

        
$validateSSL = empty($this->validateSSL) ? true $this->validateSSL;
        
$this->validateSSL $validateSSL;

        
$this->show_totals var_export($this->show_totalstrue);
    }

    
/**
     * Perform PayPal API request & return response.
     *
     * @throws \Throwable
     *
     * @return StreamInterface
     */
    
private function makeHttpRequest(): StreamInterface
    
{
        try {
            return 
$this->client->{$this->verb}(
                
$this->apiUrl,
                
$this->options
            
)->getBody();
        } catch (
HttpClientException $e) {
            throw new 
RuntimeException($e->getResponse()->getBody());
        }
    }

    
/**
     * Function To Perform PayPal API Request.
     *
     * @param bool $decode
     *
     * @throws \Throwable
     *
     * @return array|StreamInterface|string
     */
    
private function doPayPalRequest(bool $decode true)
    {
        try {
            
$this->apiUrl collect([$this->config['api_url'], $this->apiEndPoint])->implode('/');

            
// Perform PayPal HTTP API request.
            
$response $this->makeHttpRequest();

            return (
$decode === false) ? $response->getContents() : Utils::jsonDecode($responsetrue);
        } catch (
RuntimeException $t) {
            
$error = ($decode === false) || (Str::isJson($t->getMessage()) === false) ? $t->getMessage() : Utils::jsonDecode($t->getMessage(), true);

            return [
'error' => $error];
        }
    }
}

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