!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/paymentwall/paymentwall-php/lib/Paymentwall/   drwxrwxr-x
Free 13.06 GB of 57.97 GB (22.52%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

abstract class Paymentwall_ApiObject extends Paymentwall_Instance
{
    const 
API_BRICK_SUBPATH            'brick';
    const 
API_OBJECT_CHARGE         'charge';
    const 
API_OBJECT_SUBSCRIPTION     'subscription';
    const 
API_OBJECT_ONE_TIME_TOKEN 'token';

    protected 
$properties = array();
    protected 
$_id;
    protected 
$_rawResponse '';
    protected 
$_responseLogInformation = array();
    protected 
$brickSubEndpoints = array(
        
self::API_OBJECT_CHARGEself::API_OBJECT_SUBSCRIPTIONself::API_OBJECT_ONE_TIME_TOKEN
    
);

    abstract function 
getEndpointName();

    public function 
__construct($id '')
    {
        if (!empty(
$id)) {
            
$this->_id $id;
        }
    }

    public final function 
create($params = array())
    {
        
$httpAction = new Paymentwall_HttpAction($this$params, array(
            
$this->getApiBaseHeader()
        ));
        
$this->setPropertiesFromResponse($httpAction->run());
        return 
$this;
    }

    public function 
__get($property)
    {
        return isset(
$this->properties[$property]) ? $this->properties[$property] : null;
    }

    public function 
getApiUrl()
    {
        if (
$this->getEndpointName() === self::API_OBJECT_ONE_TIME_TOKEN && !$this->getConfig()->isTest()) {
            return 
Paymentwall_OneTimeToken::GATEWAY_TOKENIZATION_URL;
        } else {
            return 
$this->getApiBaseUrl() . $this->getSubPath() . '/' $this->getEndpointName();
        }
    }

    
/**
     * Returns raw data about the response that can be presented to the end-user: 
     *     success => 0 or 1
     *    error => 
     *        message     - human-readable error message
     *        code         - error code, see https://www.paymentwall.com/us/documentation/Brick/2968#error
     *     secure => 
     *        formHTML     - needed to complete 3D Secure step, HTML of the form to be submitted to the user to redirect him to the bank page
     *
     * @return array 
     *                
     */
    
public function _getPublicData()
    {
        
/*$responseModel = Paymentwall_Response_Factory::get($this->getPropertiesFromResponse());
        return $responseModel instanceof Paymentwall_Response_Interface ? $responseModel->process() : '';*/

        /**
         * @todo encapsulate this into Paymentwall_Response_Factory better; right now it returns success=1 for 3ds case
         */
        
$response $this->getPropertiesFromResponse();
        
$result = array();
        if (isset(
$response['type']) && $response['type'] == 'Error') {
            
$result = array(
                
'success' => 0,
                
'error' => array(
                    
'message' => $response['error'],
                    
'code' => $response['code']
                )
            );
        }
        elseif (!empty(
$response['secure'])) {
            
$result = array(
                
'success' => 0,
                
'secure' => $response['secure']
            );
        }
        elseif (
$this->isSuccessful()) {
            
$result['success'] = 1;
        }
        else {
            
$result = array(
                
'success' => 0,
                
'error' => array(
                    
'message' => 'Internal error'
                
)
            );
        }
        return 
$result;
    }

    
/**
     * @return string json encoded result of ApiObject::getPublicData()
     */
    
public function getPublicData() 
    {
        return 
json_encode($this->_getPublicData());
    }

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

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

    protected function 
setPropertiesFromResponse($response '')
    {
        if (!empty(
$response)) {
            
$this->_rawResponse $response;
            
$this->properties = (array) $this->preparePropertiesFromResponse($response);
        } else {
            throw new 
Exception('Empty response');
        }
    }

    protected function 
getSubPath()
    {
        return (
in_array($this->getEndpointName(), $this->brickSubEndpoints))
                ? 
'/' self::API_BRICK_SUBPATH
                
'';
    }

    protected function 
getPropertiesFromResponse()
    {
        return 
$this->properties;
    }

    protected function 
preparePropertiesFromResponse($string '')
    {
        return 
json_decode($stringfalse);
    }

    protected function 
getApiBaseHeader()
    {
        return 
'X-ApiKey: ' $this->getPrivateKey();
    }

    protected function 
doApiAction($action ''$method 'post')
    {
        
$actionUrl $this->getApiUrl() . '/' $this->_id '/' $action;
        
$httpAction = new Paymentwall_HttpAction($this, array('id' => $this->_id), array(
            
$this->getApiBaseHeader()
        ));
        
$this->_responseLogInformation $httpAction->getResponseLogInformation();
        
$this->setPropertiesFromResponse(
            
$method == 'get' $httpAction->get($actionUrl) : $httpAction->post($actionUrl)
        );

        return 
$this;
    }

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


}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0094 ]--