!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/Modules/PaymentGateway/SenderIdPurchaseGateway/   drwxr-xr-x
Free 28.6 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:     PaystackPayment.php (5.06 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Modules\PaymentGateway\SenderIdPurchaseGateway;

use 
App\Models\BillingRequest;
use 
App\Models\Customer;
use 
App\Models\Number;
use 
App\Models\NumberRequest;
use 
App\Models\Plan;
use 
App\Models\SenderId;
use 
Carbon\Carbon;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Config;
use 
Illuminate\Support\Facades\Log;
use 
Unicodeveloper\Paystack\Paystack;

class 
PaystackPayment implements PaymentInterface
{
    public 
$planReq;
    public 
$redirect_url;
    public 
$error_message;
    public 
$return_view;
    public 
$will_redirectfalse;

    public function 
__construct()
    {

    }

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

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

        if (!isset(
$credentials->paystack_status) || !$credentials->paystack_merchant_email || !$credentials->paystack_payment_url || !$credentials->paystack_public_key || !$credentials->paystack_secret_key || $credentials->paystack_status != 'active') {
            throw new 
\Exception(trans('Invalid Payment'));
        }
        return 
$credentials;
    }

    public function 
senderID($senderID)
    {
        
$this->sender_id $senderID;
        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()
    {
        
$paystackData $this->payStackPayment($this->planReq$this->request);
        if (
$paystackData) {
            
$this->redirect_url $paystackData->redirectNow();
            
$this->will_redirect true;
            
$this->return_view null;
        }
    }


    function 
payStackPayment($senderId$request)
    {
        
$credentials json_decode(get_settings('payment_gateway'));
        
$sender_id auth('customer')->user()->sender_ids()->where('id'$senderId)->first();
        if (!isset(
$credentials->paystack_public_key) || !$credentials->paystack_secret_key || $credentials->paystack_status != 'active') {
            throw new 
\Exception(trans('layout.message.invalid_payment'));
        }

        
$data = [
            
'secretKey' => $credentials->paystack_secret_key,
            
'publicKey' => $credentials->paystack_public_key,
            
'paymentUrl' => $credentials->paystack_payment_url
        
];

        if (
$credentials->paystack_merchant_email) {
            
$data['merchantEmail'] = $credentials->paystack_merchant_email;
        }
        
Config::set('paystack'$data);
        
$price json_decode(get_settings('senderid_price'))->sender_id_price;
        
$paystack = new Paystack();
        
$user auth()->user();
        
$request->email $user->email;
        
$request->orderID "SENDER_" $sender_id->id;
        
$request->amount $price 100;
        
$request->quantity 1;
        
$request->currency 'USD';
        
$request->reference $paystack->genTranxRef();
        
$request->callback_url route('paymentgateway::payment.number.paystack.process');
        
$request->metadata json_encode(['sender_id' => $sender_id->id]);
        return 
$paystack->getAuthorizationUrl();

    }

    public function 
processPaystackPayment(Request $request)
    {
        
$credentials json_decode(get_settings('payment_gateway'));

        if (!isset(
$credentials->paystack_public_key) || !$credentials->paystack_secret_key || $credentials->paystack_status != 'active') {
            throw new 
\Exception(trans('Invalid Request'));
        }

        
$data = [
            
'secretKey' => $credentials->paystack_secret_key,
            
'publicKey' => $credentials->paystack_public_key,
            
'paymentUrl' => $credentials->paystack_payment_url
        
];

        if (
$credentials->paystack_merchant_email) {
            
$data['merchantEmail'] = $credentials->paystack_merchant_email;
        }
        
Config::set('paystack'$data);

        
$paymentDetails paystack()->getPaymentData();

        if (isset(
$paymentDetails['data']) && isset($paymentDetails['data']['id'])) {
            
$sender_id = isset($paymentDetails['data']['metadata']['sender_id']) ? $paymentDetails['data']['metadata']['sender_id'] : '';
            if (
$sender_id) {
                
$senderId SenderId::find($sender_id->id);
                if (!
$senderId) {
                    
Log::info("SenderID not found -" $sender_id->id);
                    exit;
                };
                
$senderId->is_paid 'yes';
                
$senderId->save();
            }
            
Log::info("Meta data not found");
            
$this->error_message'Meta data not found';
            exit;
        } else {
            
$this->error_messagetrans('Invalid payment');
        }
    }


}

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