!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/vendor/vonage/client-core/src/Account/   drwxr-xr-x
Free 28.64 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
Vonage\Account;

use 
Psr\Http\Client\ClientExceptionInterface;
use 
Vonage\Client\APIClient;
use 
Vonage\Client\APIResource;
use 
Vonage\Client\Exception as ClientException;
use 
Vonage\Client\Exception\Request as ClientRequestException;
use 
Vonage\Entity\Filter\KeyValueFilter;

use function 
count;
use function 
is_null;
use function 
json_decode;

/**
 * @todo Unify the exception handling to avoid duplicated code and logic (ie: getPrefixPricing())
 */
class Client implements APIClient
{
    public function 
__construct(protected ?APIResource $accountAPI null)
    {
    }

    public function 
getAPIResource(): APIResource
    
{
        return clone 
$this->accountAPI;
    }

    
/**
     * Returns pricing based on the prefix requested
     *
     * @return array<PrefixPrice>
     */
    
public function getPrefixPricing(string $prefix): array
    {
        
$api $this->getAPIResource();
        
$api->setBaseUri('/account/get-prefix-pricing/outbound');
        
$api->setCollectionName('prices');

        
$data $api->search(new KeyValueFilter(['prefix' => $prefix]));

        if (
count($data) === 0) {
            return [];
        }

        
// Multiple countries can match each prefix
        
$prices = [];

        foreach (
$data as $p) {
            
$prefixPrice = new PrefixPrice();
            
$prefixPrice->fromArray($p);
            
$prices[] = $prefixPrice;
        }

        return 
$prices;
    }

    
/**
     * Get SMS Pricing based on Country
     *
     * @throws ClientExceptionInterface
     * @throws ClientRequestException
     * @throws ClientException\Exception
     * @throws ClientException\Server
     */
    
public function getSmsPrice(string $country): SmsPrice
    
{
        
$body $this->makePricingRequest($country'sms');
        
$smsPrice = new SmsPrice();
        
$smsPrice->fromArray($body);

        return 
$smsPrice;
    }

    
/**
     * Get Voice pricing based on Country
     *
     * @throws ClientExceptionInterface
     * @throws ClientRequestException
     * @throws ClientException\Exception
     * @throws ClientException\Server
     */
    
public function getVoicePrice(string $country): VoicePrice
    
{
        
$body $this->makePricingRequest($country'voice');
        
$voicePrice = new VoicePrice();
        
$voicePrice->fromArray($body);

        return 
$voicePrice;
    }

    
/**
     * @throws ClientRequestException
     * @throws ClientException\Exception
     * @throws ClientException\Server
     * @throws ClientExceptionInterface
     *
     * @todo This should return an empty result instead of throwing an Exception on no results
     */
    
protected function makePricingRequest($country$pricingType): array
    {
        
$api $this->getAPIResource();
        
$api->setBaseUri('/account/get-pricing/outbound/' $pricingType);
        
$results $api->search(new KeyValueFilter(['country' => $country]));
        
$pageData $results->getPageData();

        if (
is_null($pageData)) {
            throw new 
ClientException\Server('No results found');
        }

        return 
$pageData;
    }

    
/**
     * Gets the accounts current balance in Euros
     *
     * @throws ClientExceptionInterface
     * @throws ClientException\Exception
     * @throws ClientException\Server
     *
     * @todo This needs further investigated to see if '' can even be returned from this endpoint
     */
    
public function getBalance(): Balance
    
{
        
$data $this->getAPIResource()->get('get-balance', [], ['accept' => 'application/json']);

        if (
is_null($data)) {
            throw new 
ClientException\Server('No results found');
        }

        return new 
Balance($data['value'], $data['autoReload']);
    }

    
/**
     * @throws ClientExceptionInterface
     * @throws ClientException\Exception
     */
    
public function topUp(string $trx): void
    
{
        
$api $this->getAPIResource();
        
$api->setBaseUri('/account/top-up');
        
$api->submit(['trx' => $trx]);
    }

    
/**
     * Return the account settings
     *
     * @throws ClientExceptionInterface
     * @throws ClientException\Exception
     * @throws ClientException\Server
     */
    
public function getConfig(): Config
    
{
        
$api $this->getAPIResource();
        
$api->setBaseUri('/account/settings');
        
$body $api->submit();

        if (
$body === '') {
            throw new 
ClientException\Server('Response was empty');
        }

        
$body json_decode($bodytrue);

        return new 
Config(
            
$body['mo-callback-url'],
            
$body['dr-callback-url'],
            
$body['max-outbound-request'],
            
$body['max-inbound-request'],
            
$body['max-calls-per-second']
        );
    }

    
/**
     * Update account config
     *
     * @throws ClientExceptionInterface
     * @throws ClientException\Exception
     * @throws ClientException\Server
     */
    
public function updateConfig(array $options): Config
    
{
        
// supported options are SMS Callback and DR Callback
        
$params = [];

        if (isset(
$options['sms_callback_url'])) {
            
$params['moCallBackUrl'] = $options['sms_callback_url'];
        }

        if (isset(
$options['dr_callback_url'])) {
            
$params['drCallBackUrl'] = $options['dr_callback_url'];
        }

        
$api $this->getAPIResource();
        
$api->setBaseUri('/account/settings');

        
$rawBody $api->submit($params);

        if (
$rawBody === '') {
            throw new 
ClientException\Server('Response was empty');
        }

        
$body json_decode($rawBodytrue);

        return new 
Config(
            
$body['mo-callback-url'],
            
$body['dr-callback-url'],
            
$body['max-outbound-request'],
            
$body['max-inbound-request'],
            
$body['max-calls-per-second']
        );
    }
}

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