diff --git a/app/Http/Controllers/Admin/OfflinePaymentController.php b/app/Http/Controllers/Admin/OfflinePaymentController.php deleted file mode 100644 index 79eedb2..0000000 --- a/app/Http/Controllers/Admin/OfflinePaymentController.php +++ /dev/null @@ -1,218 +0,0 @@ -status == 'approved') { - $payments->where('status', 1); - } elseif ($request->status == 'suspended') { - $payments->where('status', 2); - } elseif ($request->status == 'pending') { - $payments->where('status', 0)->orWhere('status', null); - } - - $page_data['payments'] = $payments->paginate(10); - return view('admin.offline_payments.index', $page_data); - } - - public function download_doc($id) - { - // validate id - if (empty($id)) { - Session::flash('error', get_phrase('Data not found.')); - return redirect()->back(); - } - - // payment details - $payment_details = OfflinePayment::where('id', $id)->first(); - $filePath = public_path($payment_details->doc); - if (! file_exists($filePath)) { - Session::flash('error', get_phrase('Data not found.')); - return redirect()->back(); - } - // download file - return Response::download($filePath); - } - - public function accept_payment($id) - { - // validate id - if (empty($id)) { - Session::flash('error', get_phrase('Id can not be empty.')); - return redirect()->back(); - } - - // payment details - $query = OfflinePayment::where('id', $id)->where('status', 0); - if ($query->doesntExist()) { - Session::flash('error', get_phrase('Data not found.')); - return redirect()->back(); - } - - $payment_details = $query->first(); - - $payment['invoice'] = Str::random(20); - $payment['user_id'] = $payment_details['user_id']; - $payment['payment_type'] = 'offline'; - $payment['coupon'] = $payment_details->coupon; - - if ($payment_details->item_type == 'course') { - $items = json_decode($payment_details->items); - - foreach ($items as $item) { - $course = Course::where('id', $item)->first(); - $payment['course_id'] = $course->id; - - // Calculate base amount - $amount = $course->discount_flag == 1 ? $course->discounted_price : $course->price; - - // Apply coupon discount if applicable - $discounted_price = 0; - if ($payment_details->coupon) { - $coupon = Coupon::where('code', $payment_details->coupon)->first(); - if ($coupon) { - $discounted_price = $amount * ($coupon->discount / 100); - } - } - - // Final payment amount and tax - $final_amount = $amount - $discounted_price; - $payment['amount'] = $final_amount; - $payment['tax'] = (get_settings('course_selling_tax') / 100) * $final_amount; - - // Calculate admin and instructor revenue - if (get_course_creator_id($course->id)->role == 'admin') { - $payment['admin_revenue'] = $final_amount; - } else { - $payment['instructor_revenue'] = $final_amount * (get_settings('instructor_revenue') / 100); - $payment['admin_revenue'] = $final_amount - $payment['instructor_revenue']; - } - - // Insert payment record - $accept_payment = Payment_history::insert($payment); - - // Enroll user in course if payment succeeds - if ($accept_payment) { - - $enroll['user_id'] = $payment_details['user_id']; - $enroll['course_id'] = $course->id; - $enroll['enrollment_type'] = "paid"; - $enroll['entry_date'] = time(); - $enroll['created_at'] = date('Y-m-d H:i:s'); - $enroll['updated_at'] = date('Y-m-d H:i:s'); - - if ($course->expiry_period > 0) { - $days = $course->expiry_period * 30; - $enroll['expiry_date'] = strtotime("+" . $days . " days"); - } else { - $enroll['expiry_date'] = null; - } - - Enrollment::insert($enroll); - } - } - } elseif ($payment_details->item_type == 'bootcamp') { - $bootcamps = Bootcamp::whereIn('id', json_decode($payment_details->items, true))->get(); - foreach($bootcamps as $bootcamp){ - $bootcamp_payment['invoice'] = '#' . Str::random(20); - $bootcamp_payment['user_id'] = $payment_details['user_id']; - $bootcamp_payment['bootcamp_id'] = $bootcamp->id; - $bootcamp_payment['price'] = $bootcamp->discount_flag == 1 ? $bootcamp->price - $bootcamp->discounted_price : $bootcamp->price; - $bootcamp_payment['tax'] = 0; - $bootcamp_payment['payment_method'] = 'offline'; - $bootcamp_payment['status'] = 1; - - // insert bootcamp purchase - BootcampPurchase::insert($bootcamp_payment); - } - } elseif ($payment_details->item_type == 'package') { - $packages = TeamTrainingPackage::whereIn('id', json_decode($payment_details->items, true))->get(); - foreach($packages as $package){ - $package_payment['invoice'] = '#' . Str::random(20); - $package_payment['user_id'] = $payment_details['user_id']; - $package_payment['package_id'] = $package->id; - $package_payment['price'] = $package->price; - $package_payment['tax'] = 0; - $package_payment['payment_method'] = 'offline'; - $package_payment['status'] = 1; - - // insert package purchase - TeamPackagePurchase::insert($package_payment); - } - } elseif ($payment_details->item_type == 'tutor_booking') { - $schedules = TutorSchedule::whereIn('id', json_decode($payment_details->items, true))->get(); - foreach($schedules as $schedule){ - - $schedule_payment['invoice'] = '#' . Str::random(20); - $schedule_payment['student_id'] = $payment_details['user_id']; - $schedule_payment['schedule_id'] = $schedule->id; - $schedule_payment['price'] = $payment_details['total_amount']; - $schedule_payment['tax'] = $payment_details['tax']; - $schedule_payment['payment_method'] = 'offline'; - - $schedule = TutorSchedule::find($schedule->id); - if (get_user_info($schedule->tutor_id)->role == 'admin') { - $schedule_payment['admin_revenue'] = $payment_details['payable_amount']; - } else { - $schedule_payment['instructor_revenue'] = $payment_details['total_amount'] * (get_settings('instructor_revenue') / 100); - $schedule_payment['admin_revenue'] = $payment_details['total_amount'] - $schedule_payment['instructor_revenue']; - } - - $schedule_payment['tutor_id'] = $schedule->tutor_id; - $schedule_payment['start_time'] = $schedule->start_time; - $schedule_payment['end_time'] = $schedule->end_time; - - // insert tutor bookings - TutorBooking::insert($schedule_payment); - } - } - - // remove items from offline payment - OfflinePayment::where('id', $id)->update(['status' => 1]); - - // go back - Session::flash('success', 'Payment has been accepted.'); - return redirect()->route('admin.offline.payments'); - } - - public function decline_payment($id) - { - // remove items from offline payment - OfflinePayment::where('id', $id)->update(['status' => 2]); - - // go back - Session::flash('success', 'Payment has been suspended'); - return redirect()->route('admin.offline.payments'); - } - - public function delete_payment($id) - { - OfflinePayment::where('id', $id)->delete(); - Session::flash('success', get_phrase('Admin revenue delete successfully')); - return redirect()->route('admin.offline.payments'); - } -} diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 8777fdf..9da64e4 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -2,20 +2,9 @@ namespace App\Http\Controllers; -use Anand\LaravelPaytmWallet\Facades\PaytmWallet; -use App\Models\FileUploader; -use App\Models\payment_gateway\Paystack; -use App\Models\payment_gateway\Ccavenue; -use App\Models\payment_gateway\Pagseguro; -use App\Models\payment_gateway\Xendit; -use App\Models\payment_gateway\Doku; -use App\Models\payment_gateway\Skrill; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; -use Illuminate\Support\Facades\Validator; -use Illuminate\Support\Str; -use paytm\paytmchecksum\PaytmChecksum; class PaymentController extends Controller { @@ -69,8 +58,6 @@ class PaymentController extends Controller } - - public function payment_create($identifier) { $payment_details = session('payment_details'); @@ -82,13 +69,6 @@ class PaymentController extends Controller return redirect()->to($created_payment_link); } - public function payment_notification(Request $request, $identifier) - { - if ($identifier == 'doku') { - Doku::payment_status($identifier, $request->all(), $request->headers->all()); - } - } - public function payment_razorpay($identifier) { $payment_details = session('payment_details'); @@ -100,307 +80,6 @@ class PaymentController extends Controller return view('payment.razorpay.payment', compact('data')); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public function make_paytm_order(Request $request) - { - - //start common code of all payment gateway - // $identifier = 'paytm'; - // $payment_details = session('payment_details'); - // $model = $payment_details['success_method']['model_name']; - // $payment_gateway = DB::table('payment_gateways')->where('identifier', $identifier)->first(); - // $user = auth()->user(); - - // $paytm_merchant_key = $paytm_merchant_mid = $paytm_merchant_website = $industry_type_id = $channel_id = ''; - // if ($model == 'InstructorPayment') { - // $instructor_payment_keys = DB::table('users') - // ->where('id', $payment_details['items'][0]['id']) - // ->value('paymentkeys'); - // $keys = isset($instructor_payment_keys) ? json_decode($instructor_payment_keys) : null; - // if ($keys) { - // $paytm_merchant_key = $keys->paytm->paytm_merchant_key; - // $paytm_merchant_mid = $keys->paytm->paytm_merchant_mid; - // $paytm_merchant_website = $keys->paytm->paytm_merchant_website; - // $industry_type_id = $keys->paytm->industry_type_id; - // $channel_id = $keys->paytm->channel_id; - // } - // } else { - // $keys = json_decode($payment_gateway->keys); - // $paytm_merchant_key = $keys->paytm_merchant_key; - // $paytm_merchant_mid = $keys->paytm_merchant_mid; - // $paytm_merchant_website = $keys->paytm_merchant_website; - // $industry_type_id = $keys->industry_type_id; - // $channel_id = $keys->channel_id; - // } - - // if ($payment_gateway->test_mode == 1) { - // $PAYTM_STATUS_QUERY_NEW_URL = 'https://securegw-stage.paytm.in/merchant-status/getTxnStatus'; - // $PAYTM_TXN_URL = 'https://securegw-stage.paytm.in/theia/processTransaction'; - // } else { - // define('PAYTM_ENVIRONMENT', 'PROD'); // PROD or TEST - // $PAYTM_STATUS_QUERY_NEW_URL = 'https://securegw.paytm.in/merchant-status/getTxnStatus'; - // $PAYTM_TXN_URL = 'https://securegw.paytm.in/theia/processTransaction'; - // } - // $paramList = []; - // $paramList['MID'] = $paytm_merchant_mid; - // $paramList['ORDER_ID'] = 'ORDS2123' . $user->id; - // $paramList['CUST_ID'] = 'CUST' . $user->id; - // $paramList['INDUSTRY_TYPE_ID'] = $industry_type_id; - // $paramList['CHANNEL_ID'] = $channel_id; - // $paramList['TXN_AMOUNT'] = $payment_details['payable_amount']; - // $paramList['WEBSITE'] = $paytm_merchant_website; - // $paramList['CALLBACK_URL'] = $payment_details['success_url'] . '/' . $identifier; - - - - - - - - - - - - // $paytmParams = array(); - - // $paytmParams["body"] = array( - // "requestType" => "Payment", - // "mid" => $paytm_merchant_mid, - // "websiteName" => $paytm_merchant_website, - // "orderId" => 'ORDS2123' . $user->id, - // "callbackUrl" => $payment_details['success_url'] . '/' . $identifier, - // "txnAmount" => array( - // "value" => round($payment_details['payable_amount'], 2), - // "currency" => "INR", - // ), - // "userInfo" => array( - // "custId" => "CUST_".$user->id, - // ), - // ); - - - // $checksum = PaytmChecksum::generateSignature(json_encode($paramList, JSON_UNESCAPED_SLASHES), $paytm_merchant_key); - // echo PaytmChecksum::verifySignature($paramList, $paytm_merchant_key, $checksum); - - // // $checksum = str_replace('/', '', $checksum); - // // $checksum = str_replace('=', '', $checksum); - - // $paytmParams["head"] = array( - // "signature" => $checksum, - // "channelId" => $channel_id - // ); - - // $post_data = json_encode($paytmParams, JSON_UNESCAPED_SLASHES); - - // /* for Staging */ - // $url = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=$paytm_merchant_mid&orderId=ORDS2123" . $user->id; - - // $ch = curl_init($url); - // curl_setopt($ch, CURLOPT_POST, 1); - // curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); - // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - // curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); - // $response = curl_exec($ch); - // print_r($response); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return view('payment.paytm.paytm_merchant_checkout'); - } - - public function paytm_paymentCallback() - { - $transaction = PaytmWallet::with('receive'); - $response = $transaction->response(); - $order_id = $transaction->getOrderId(); // return a order id - $transaction->getTransactionId(); // return a transaction id - - // update the db data as per result from api call - if ($transaction->isSuccessful()) { - Paytm::where('order_id', $order_id)->update(['status' => 1, 'transaction_id' => $transaction->getTransactionId()]); - return redirect(route('initiate.payment'))->with('message', "Your payment is successfull."); - } else if ($transaction->isFailed()) { - Paytm::where('order_id', $order_id)->update(['status' => 0, 'transaction_id' => $transaction->getTransactionId()]); - return redirect(route('initiate.payment'))->with('message', "Your payment is failed."); - } else if ($transaction->isOpen()) { - Paytm::where('order_id', $order_id)->update(['status' => 2, 'transaction_id' => $transaction->getTransactionId()]); - return redirect(route('initiate.payment'))->with('message', "Your payment is processing."); - } - $transaction->getResponseMessage(); //Get Response Message If Available - - } - - public function doku_checkout($identifier) - { - $payment_gateway = DB::table('payment_gateways')->where('identifier', $identifier)->first(); - $keys = json_decode($payment_gateway->keys, true); - $test_mode = $payment_gateway->test_mode == 1 ? 1 : 0; - $client_id = $keys['client_id']; - if ($test_mode == 1) { - $key = $keys['public_test_key']; - $secret_key = $keys['secret_test_key']; - } else { - $key = $keys['public_live_key']; - $secret_key = $keys['secret_live_key']; - } - - $user_id = auth()->user()->id; - $user = DB::table('users')->where('id', $user_id)->first(); - $currency = $payment_gateway->currency; - $payment_details = session('payment_details'); - $product_title = $payment_details['items'][0]['title']; - $amount = $payment_details['items'][0]['price']; - - //Store temporary data - Doku::storeTempData(); - - $requestBody = array( - 'order' => array( - 'amount' => $amount, - 'invoice_number' => 'INV-' . rand(1, 10000), // Change to your business logic - 'currency' => $currency, - 'callback_url' => $payment_details["success_url"] . "/$identifier", - 'line_items' => array( - 0 => array( - 'name' => $product_title, - 'price' => $amount, - 'quantity' => 1, - ), - ), - ), - 'payment' => array( - 'payment_due_date' => 60, - ), - 'customer' => array( - 'id' => 'CUST-' . rand(1, 1000), // Change to your customer ID mapping - 'name' => $user->name, - 'email' => $user->email, - 'phone' => $user->phone, - 'address' => $user->address, - 'country' => 'ID', - ), - ); - - $requestId = rand(1, 100000); // Change to UUID or anything that can generate unique value - $dateTime = gmdate("Y-m-d H:i:s"); - $isoDateTime = date(DATE_ISO8601, strtotime($dateTime)); - $dateTimeFinal = substr($isoDateTime, 0, 19) . "Z"; - $clientId = $client_id; // Change with your Client ID - $secretKey = $secret_key; // Change with your Secret Key - - // $getUrl = 'https://api-sandbox.doku.com'; - - if ($test_mode == 1) { - $getUrl = 'https://api-sandbox.doku.com'; - } else { - $getUrl = 'https://api.doku.com'; - } - - $targetPath = '/checkout/v1/payment'; - $url = $getUrl . $targetPath; - - // Generate digest - $digestValue = base64_encode(hash('sha256', json_encode($requestBody), true)); - - // Prepare signature component - $componentSignature = "Client-Id:" . $clientId . "\n" . - "Request-Id:" . $requestId . "\n" . - "Request-Timestamp:" . $dateTimeFinal . "\n" . - "Request-Target:" . $targetPath . "\n" . - "Digest:" . $digestValue; - - // Generate signature - $signature = base64_encode(hash_hmac('sha256', $componentSignature, $secretKey, true)); - - // Execute request - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($requestBody)); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Content-Type: application/json', - 'Client-Id:' . $clientId, - 'Request-Id:' . $requestId, - 'Request-Timestamp:' . $dateTimeFinal, - 'Signature:' . "HMACSHA256=" . $signature, - )); - - // Set response json - $responseJson = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - - curl_close($ch); - // Echo the response - if (is_string($responseJson) && $httpCode == 200) { - return json_decode($responseJson, true); - } else { - return null; - } - } - public function webRedirectToPayFee(Request $request) { // Check if the 'auth' query parameter is present diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 6d53d76..d5c4fc8 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -257,160 +257,7 @@ class SettingController extends Controller $razorpay = json_encode($razorpay); $data = array_splice($data, 0, 4); $data['keys'] = $razorpay; - } elseif ($request->identifier == 'flutterwave') { - $flutterwave = [ - 'public_key' => $data['public_key'], - 'secret_key' => $data['secret_key'], - - ]; - $flutterwave = json_encode($flutterwave); - $data = array_splice($data, 0, 4); - $data['keys'] = $flutterwave; - } elseif ($request->identifier == 'paytm') { - $paytm = [ - 'paytm_merchant_key' => $data['paytm_merchant_key'] ?? '', - 'paytm_merchant_mid' => $data['paytm_merchant_mid'] ?? '', - 'paytm_merchant_website' => $data['paytm_merchant_website'] ?? '', - 'industry_type_id' => $data['industry_type_id'] ?? '', - 'channel_id' => $data['channel_id'] ?? '', - ]; - $paytm = json_encode($paytm); - $data = array_splice($data, 0, 4); - $data['keys'] = $paytm; - } elseif ($request->identifier == 'offline') { - $offline = [ - 'bank_information' => $data['bank_information'], - - ]; - $offline = json_encode($offline); - $data = array_splice($data, 0, 4); - - $data['keys'] = $offline; - unset($data['bank_information']); - } elseif ($request->identifier == 'paystack') { - $paystack = [ - 'secret_test_key' => $data['secret_test_key'], - 'public_test_key' => $data['public_test_key'], - 'secret_live_key' => $data['secret_live_key'], - 'public_live_key' => $data['public_live_key'], - ]; - $paystack = json_encode($paystack); - $data = array_splice($data, 0, 4); - $data['keys'] = $paystack; - } elseif ($request->identifier == 'ccavenue') { - $ccavenue = [ - 'ccavenue_merchant_id' => $data['ccavenue_merchant_id'], - 'ccavenue_working_key' => $data['ccavenue_working_key'], - 'ccavenue_access_code' => $data['ccavenue_access_code'], - ]; - $ccavenue = json_encode($ccavenue); - $data = array_splice($data, 0, 4); - $data['keys'] = $ccavenue; - } elseif ($request->identifier == 'pagseguro') { - $pagseguro = [ - 'api_key' => $data['api_key'], - 'secret_key' => $data['secret_key'], - 'other_parameter' => $data['other_parameter'], - ]; - $pagseguro = json_encode($pagseguro); - $data = array_splice($data, 0, 4); - $data['keys'] = $pagseguro; - } elseif ($request->identifier == 'iyzico') { - $iyzico = [ - 'api_test_key' => $data['api_test_key'], - 'secret_test_key' => $data['secret_test_key'], - 'api_live_key' => $data['api_live_key'], - 'secret_live_key' => $data['secret_live_key'], - ]; - $iyzico = json_encode($iyzico); - $data = array_splice($data, 0, 4); - $data['keys'] = $iyzico; - } elseif ($request->identifier == 'xendit') { - $xendit = [ - 'api_key' => $data['api_key'], - 'secret_key' => $data['secret_key'], - 'other_parameter' => $data['other_parameter'], - ]; - $xendit = json_encode($xendit); - $data = array_splice($data, 0, 4); - $data['keys'] = $xendit; - } elseif ($request->identifier == 'payu') { - $payu = [ - 'pos_id' => $data['pos_id'], - 'second_key' => $data['second_key'], - 'client_id' => $data['client_id'], - 'client_secret' => $data['client_secret'], - ]; - $payu = json_encode($payu); - $data = array_splice($data, 0, 4); - $data['keys'] = $payu; - } elseif ($request->identifier == 'skrill') { - $skrill = [ - 'skrill_merchant_email' => $data['skrill_merchant_email'], - 'secret_passphrase' => $data['secret_passphrase'] - ]; - $skrill = json_encode($skrill); - $data = array_splice($data, 0, 4); - $data['keys'] = $skrill; - } elseif ($request->identifier == 'doku') { - $doku = [ - 'client_id' => $data['client_id'], - 'shared_key' => $data['shared_key'] - ]; - $doku = json_encode($doku); - $data = array_splice($data, 0, 4); - $data['keys'] = $doku; - } elseif ($request->identifier == 'maxicash') { - $maxicash = [ - 'merchant_id' => $data['merchant_id'], - 'merchant_password' => $data['merchant_password'] - ]; - $maxicash = json_encode($maxicash); - $data = array_splice($data, 0, 4); - $data['keys'] = $maxicash; - } elseif ($request->identifier == 'cashfree') { - $cashfree = [ - 'client_id' => $data['client_id'], - 'client_secret' => $data['client_secret'] - ]; - $cashfree = json_encode($cashfree); - $data = array_splice($data, 0, 4); - $data['keys'] = $cashfree; - } elseif ($request->identifier == 'aamarpay') { - $aamarpay = [ - 'store_id' => $data['store_id'], - 'signature_key' => $data['signature_key'], - 'store_live_id' => $data['store_live_id'], - 'signature_live_key' => $data['signature_live_key'] - ]; - $aamarpay = json_encode($aamarpay); - $data = array_splice($data, 0, 4); - $data['keys'] = $aamarpay; - } elseif ($request->identifier == 'tazapay') { - $tazapay = [ - 'public_key' => $data['public_key'], - 'api_key' => $data['api_key'], - 'api_secret' => $data['api_secret'] - ]; - $tazapay = json_encode($tazapay); - $data = array_splice($data, 0, 4); - $data['keys'] = $tazapay; - } elseif ($request->identifier == 'sslcommerz') { - $sslcommerz = [ - 'store_key' => $data['store_key'], - 'store_password' => $data['store_password'], - 'store_live_key' => $data['store_live_key'], - 'store_live_password' => $data['store_live_password'], - 'sslcz_testmode' => $data['sslcz_testmode'], - 'store_live_password' => $data['store_live_password'], - 'is_localhost' => $data['is_localhost'], - 'sslcz_live_testmode' => $data['sslcz_live_testmode'], - 'is_live_localhost' => $data['is_live_localhost'] - ]; - $sslcommerz = json_encode($sslcommerz); - $data = array_splice($data, 0, 4); - $data['keys'] = $sslcommerz; - } + } Payment_gateway::where('identifier', $request->identifier)->update($data); } diff --git a/app/Http/Controllers/student/BootcampPurchaseController.php b/app/Http/Controllers/student/BootcampPurchaseController.php index d728f9d..d92f120 100644 --- a/app/Http/Controllers/student/BootcampPurchaseController.php +++ b/app/Http/Controllers/student/BootcampPurchaseController.php @@ -4,9 +4,7 @@ namespace App\Http\Controllers\student; use App\Http\Controllers\Controller; use App\Models\Bootcamp; -use App\Models\OfflinePayment; use App\Models\BootcampPurchase; -use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; use Illuminate\Support\Str; @@ -51,19 +49,6 @@ class BootcampPurchaseController extends Controller return redirect()->route('my.bootcamps'); } - // check any offline processing data - $processing_payments = OfflinePayment::where([ - 'user_id' => auth()->user()->id, - 'items' => $bootcamp->id, - 'item_type' => 'bootcamp', - 'status' => 0, - ])->first(); - - if ($processing_payments) { - Session::flash('warning', get_phrase('Your request is in process.')); - return redirect()->back(); - } - // prepare bootcamp payment data $price = $bootcamp->discount_flag ? $bootcamp->price - $bootcamp->discounted_price : $bootcamp->price; $payment_details = [ diff --git a/app/Http/Controllers/student/MyTeamPackageController.php b/app/Http/Controllers/student/MyTeamPackageController.php index b79d453..ecf0cc2 100644 --- a/app/Http/Controllers/student/MyTeamPackageController.php +++ b/app/Http/Controllers/student/MyTeamPackageController.php @@ -4,7 +4,6 @@ namespace App\Http\Controllers\student; use App\Http\Controllers\Controller; use App\Models\Enrollment; -use App\Models\OfflinePayment; use App\Models\TeamPackageMember; use App\Models\TeamPackagePurchase; use App\Models\TeamTrainingPackage; @@ -185,20 +184,6 @@ class MyTeamPackageController extends Controller return redirect()->back(); } - // check any offline processing data - $processing_payments = OfflinePayment::where([ - 'user_id' => auth()->user()->id, - 'items' => $package->id, - 'item_type' => 'team_package', - 'status' => 0, - ]) - ->first(); - - if ($processing_payments) { - Session::flash('warning', get_phrase('Your request is in process.')); - return redirect()->back(); - } - // prepare team package payment data $payment_details = [ 'items' => [ diff --git a/app/Http/Controllers/student/OfflinePaymentController.php b/app/Http/Controllers/student/OfflinePaymentController.php deleted file mode 100644 index 2be0f77..0000000 --- a/app/Http/Controllers/student/OfflinePaymentController.php +++ /dev/null @@ -1,67 +0,0 @@ - 'required|mimes:jpeg,jpg,pdf,txt,png,docx,doc|max:3072', - ]; - $validator = Validator::make($request->all(), $rules); - - if ($validator->fails()) { - return redirect()->back()->withErrors($validator)->withInput(); - } - - - $file = $request->doc; - $file_name = Str::random(20) . '.' . $file->extension(); - $path = 'uploads/offline_payment/' . slugify(auth()->user()->name) . '/' . $file_name; - FileUploader::upload($file, $path, null, null, 300); - - $offline_payment['user_id'] = auth()->user()->id; - $offline_payment['item_type'] = $request->item_type; - $offline_payment['items'] = json_encode($item_id_arr); - $offline_payment['tax'] = $payment_details['tax']; - $offline_payment['total_amount'] = $payment_details['payable_amount']; - $offline_payment['doc'] = $path; - $offline_payment['coupon'] = $payment_details['coupon'] ?? null; - - // insert offline payment history - OfflinePayment::insert($offline_payment); - - // remove from cart - if ($request->item_type == 'course') { - $url = 'purchase.history'; - CartItem::whereIn('course_id', $item_id_arr)->where('user_id', auth()->user()->id)->delete(); - } elseif ($request->item_type == 'bootcamp') { - $url = 'bootcamps'; - } elseif ($request->item_type == 'package') { - $url = 'team.packages'; - } elseif ($request->item_type == 'tutor_booking') { - $url = 'tutor_list'; - } - - // return to courses - Session::flash('success', get_phrase('The payment will be completed once the admin reviews and approves it.')); - return redirect()->route($url); - } -} diff --git a/app/Http/Controllers/student/TutorBookingController.php b/app/Http/Controllers/student/TutorBookingController.php index ac9350a..37cef5c 100644 --- a/app/Http/Controllers/student/TutorBookingController.php +++ b/app/Http/Controllers/student/TutorBookingController.php @@ -6,7 +6,6 @@ use App\Http\Controllers\Controller; use App\Models\TutorBooking; use App\Models\TutorSchedule; use App\Models\TutorReview; -use App\Models\OfflinePayment; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Auth; @@ -36,7 +35,7 @@ class TutorBookingController extends Controller $view_path = 'frontend.' . get_frontend_settings('theme') . '.student.my_bookings.invoice'; return view($view_path, $page_data); } - + //paymnet public function purchase($id) @@ -55,20 +54,6 @@ class TutorBookingController extends Controller return redirect()->back(); } - // check any offline processing data - $processing_payments = OfflinePayment::where([ - 'user_id' => auth()->user()->id, - 'items' => $schedule->id, - 'item_type' => 'tutor_booking', - 'status' => 0, - ]) - ->first(); - - if ($processing_payments) { - Session::flash('warning', get_phrase('Your request is in process.')); - return redirect()->back(); - } - // prepare team package payment data $payment_details = [ 'items' => [ diff --git a/app/Models/OfflinePayment.php b/app/Models/OfflinePayment.php deleted file mode 100644 index dba6333..0000000 --- a/app/Models/OfflinePayment.php +++ /dev/null @@ -1,24 +0,0 @@ -where('identifier', $identifier)->first(); - $keys = json_decode($payment_gateway->keys, true); - - if (is_array($_POST) && $_POST['pay_status'] == "Successful") { - $transaction_keys = $_POST['mer_txnid']; - $store_id = $keys['store_id']; - $signature_key = $keys['signature_key']; - - if ($payment_gateway->test_mode == 1) { - $url = "https://sandbox.aamarpay.com/api/v1/trxcheck/request.php?request_id=$transaction_keys&store_id=$store_id&signature_key=$signature_key&type=json"; //sandbox - } else { - $url = "https://secure.aamarpay.com/api/v1/trxcheck/request.php?request_id=$transaction_keys&store_id=$store_id&signature_key=$signature_key&type=json"; //live url - } - - $curl_handle = curl_init(); - curl_setopt($curl_handle, CURLOPT_URL, $url); - curl_setopt($curl_handle, CURLOPT_VERBOSE, true); - curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false); - $buffer = curl_exec($curl_handle); - curl_close($curl_handle); - $arr = json_decode($buffer, true); - - if (is_array($arr) && $arr['pay_status'] == "Successful") { - return true; - } else { - return false; - } - } else { - return true; - } - - } - - public static function payment_create($identifier) - { - $payment_gateway = DB::table('payment_gateways')->where('identifier', $identifier)->first(); - $payment_details = session('payment_details'); - $user = DB::table('users')->where('id', auth()->user()->id)->first(); - $keys = json_decode($payment_gateway->keys, true); - - $products_name = ''; - foreach ($payment_details['items'] as $key => $value): - if ($key == 0) { - $products_name .= $value['title']; - } else { - $products_name .= ', ' . $value['title']; - } - endforeach; - - if ($payment_gateway->test_mode == 1): - $store_id = $keys['store_id']; - $signature_key = $keys['signature_key']; - $payment_url = 'https://sandbox.aamarpay.com/index.php'; - else: - $store_id = $keys['signature_key']; - $signature_key = $keys['signature_live_key']; - $payment_url = 'https://secure.aamarpay.com/index.php'; - endif; - - $curl = curl_init(); - - curl_setopt_array($curl, array( - CURLOPT_URL => $payment_url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POSTFIELDS => array('store_id' => $store_id, - 'signature_key' => $signature_key, - 'cus_name' => $user->name, - 'cus_email' => $user->email, - 'cus_city' => $user->address, - 'cus_phone' => $user->phone, - 'amount' => round($payment_details['payable_amount']), - 'currency' => $payment_gateway->currency, - 'tran_id' => "AAMAR_TXN_" . uniqid(), - 'desc' => $identifier, - 'success_url' => $payment_details['success_url'] . '/' . $payment_gateway->identifier, - 'fail_url' => $payment_details['cancel_url'], - 'cancel_url' => $payment_details['cancel_url'], - 'type' => 'json'), - )); - - $response = curl_exec($curl); - - curl_close($curl); - - $responseObj = json_decode($response); - - if (isset($responseObj->payment_url) && ! empty($responseObj->payment_url)) { - $paymentUrl = $responseObj->payment_url; - - return $paymentUrl; - - } - - } - -} diff --git a/app/Models/payment_gateway/Doku.php b/app/Models/payment_gateway/Doku.php deleted file mode 100644 index 18cfb51..0000000 --- a/app/Models/payment_gateway/Doku.php +++ /dev/null @@ -1,114 +0,0 @@ -where('identifier', $identifier)->first(); - $keys = json_decode($payment_gateway->keys, true); - $test_mode = $payment_gateway->test_mode == 1 ? 1 : 0; - - if ($test_mode == 1) { - $key = $keys['public_test_key']; - $secret_key = $keys['secret_test_key']; - } else { - $key = $keys['public_live_key']; - $secret_key = $keys['secret_live_key']; - } - - // print_r($bodyData); - - if (count($bodyData) > 0) { - // $notificationHeader = $headerData; - // $notificationBody = json_encode($bodyData); - // $notificationPath = '/payment-notification/doku'; - // // Adjust according to your notification path - // $secretKey = $secret_key; // Adjust according to your secret key - - // $digest = base64_encode(hash('sha256', $notificationBody, true)); - // $rawSignature = "Client-Id:" . $notificationHeader['Client-Id'] . "\n" - // . "Request-Id:" . $notificationHeader['Request-Id'] . "\n" - // . "Request-Timestamp:" . $notificationHeader['Request-Timestamp'] . "\n" - // . "Request-Target:" . $notificationPath . "\n" - // . "Digest:" . $digest; - - // $signature = base64_encode(hash_hmac('sha256', $rawSignature, $secretKey, true)); - // $finalSignature = 'HMACSHA256=' . $signature; - - // if ($finalSignature == $notificationHeader['Signature']) { - - // $fileHandle = fopen('doku_success.txt', 'w'); - // fwrite($fileHandle, 'Done'); - // fclose($fileHandle); - - // return true; - - // } else { - - // return false; - // } - - try { - //Set session data - $user = User::where('email', $bodyData['customer']['email'])->firstOrNew(); - Auth::login($user); - - $payment_details = json_decode($user->temp, true); - if ($payment_details['expired_on'] >= time() && $bodyData['transaction']['status'] == 'SUCCESS') { - session(['payment_details' => $payment_details]); - - $success_model = $payment_details['success_method']['model_name']; - $success_function = $payment_details['success_method']['function_name']; - $model_full_path = str_replace(' ', '', 'App\Models\ ' . $success_model); - $model_full_path::$success_function($identifier); - - // Unset all session data - User::where('email', $bodyData['customer']['email'])->update(['temp' => json_encode([])]); - session(['payment_details' => []]); - Auth::logout(); - return true; - } - } catch (\Exception $e) { - // Log the error message - Log::error('Doku error occurred: ' . $e->getMessage()); - - // Optionally handle the exception (e.g., rethrow or show a custom error message) - return response()->json(['error' => 'Something went wrong!'], 500); - } - } else { - return "submitted"; - } - } - - public static function storeTempData() - { - //Store payment data temporary - Schema::table('users', function (Blueprint $table) { - if (! Schema::hasColumn('users', 'temp')) { - $table->text('temp')->nullable(); - } - }); - $payment_details = session('payment_details'); - $payment_details['expired_on'] = time() + 300; - User::where('id', auth()->user()->id)->update(['temp' => json_encode($payment_details)]); - session(['payment_details' => []]); - } -} diff --git a/app/Models/payment_gateway/Flutterwave.php b/app/Models/payment_gateway/Flutterwave.php deleted file mode 100644 index b9ab33e..0000000 --- a/app/Models/payment_gateway/Flutterwave.php +++ /dev/null @@ -1,21 +0,0 @@ - $transaction_keys]); - return true; - } - return false; - } -} diff --git a/app/Models/payment_gateway/Maxicash.php b/app/Models/payment_gateway/Maxicash.php deleted file mode 100644 index 1b32288..0000000 --- a/app/Models/payment_gateway/Maxicash.php +++ /dev/null @@ -1,70 +0,0 @@ - $transaction_keys]); - return true; - } - return false; - - } - - public static function payment_create($identifier) - { - $identifier = 'maxicash'; - $payment_gateway = DB::table('payment_gateways')->where('identifier', $identifier)->first(); - $user = DB::table('users')->where('id', auth()->user()->id)->first(); - $payment_details = session('payment_details'); - $keys = json_decode($payment_gateway->keys, true); - - $products_name = ''; - foreach ($payment_details['items'] as $key => $value): - if ($key == 0) { - $products_name .= $value['title']; - } else { - $products_name .= ', ' . $value['title']; - } - endforeach; - - $merchant_id = $keys['merchant_id']; - $merchant_password = $keys['merchant_password']; - - $data1 = [ - "PayType" => $identifier, - "MerchantID" => $merchant_id, - "MerchantPassword" => $merchant_password, - "Amount" => (string) round($payment_details['payable_amount'] * 100), - "Currency" => $payment_gateway->currency, - "Telephone" => $user->phone, - "Language" => "en", - "Reference" => "MAXI_TXN_" . uniqid(), - "accepturl" => $payment_details['success_url'] . '/' . $payment_gateway->identifier, - "declineurl" => $payment_details['cancel_url'], - "cancelurl" => $payment_details['cancel_url'], - "notifyurl" => $payment_details['cancel_url'], - ]; - - $data = json_encode($data1); - - if ($payment_gateway->test_mode == 1) { - $url = 'https://api-testbed.maxicashapp.com/payentry?data=' . $data; - } else { - $url = 'https://api.maxicashapp.com/payentry?data=' . $data; - } - - return $url; - - } -} diff --git a/app/Models/payment_gateway/Paystack.php b/app/Models/payment_gateway/Paystack.php deleted file mode 100644 index 7d8867a..0000000 --- a/app/Models/payment_gateway/Paystack.php +++ /dev/null @@ -1,61 +0,0 @@ -where('identifier', $identifier)->first(); - $keys = json_decode($payment_gateway->keys, true); - $test_mode = $payment_gateway->test_mode == 1 ? 1 : 0; - if($test_mode == 1){ - $secret_key = $keys['secret_test_key']; - } else { - $secret_key = $keys['secret_live_key']; - } - $reference = isset($_GET['reference']) ? $_GET['reference'] : ''; - - $curl = curl_init(); - - curl_setopt_array($curl, array( - CURLOPT_URL => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http")."://api.paystack.co/transaction/verify/".$_GET['reference'], - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => "", - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 30, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => "GET", - CURLOPT_HTTPHEADER => array( - "Authorization: Bearer ".$secret_key, - "Cache-Control: no-cache", - ), - )); - - $response = curl_exec($curl); - $err = curl_error($curl); - curl_close($curl); - - if ($err) { - return false; - } else { - return true; - } - } - - - - - -} diff --git a/app/Models/payment_gateway/Paytm.php b/app/Models/payment_gateway/Paytm.php deleted file mode 100644 index bb59911..0000000 --- a/app/Models/payment_gateway/Paytm.php +++ /dev/null @@ -1,25 +0,0 @@ - 0) { - array_shift($transaction_keys); - session(['keys' => $transaction_keys]); - return true; - } - return false; - } -} diff --git a/app/Models/payment_gateway/Sslcommerz.php b/app/Models/payment_gateway/Sslcommerz.php deleted file mode 100644 index 82d384b..0000000 --- a/app/Models/payment_gateway/Sslcommerz.php +++ /dev/null @@ -1,136 +0,0 @@ -where('identifier', $identifier)->first(); - $keys = json_decode($payment_gateway->keys, true); - - $val_id = urlencode($_POST['val_id']); - $store_key = $keys['store_key']; - $store_password = $keys['store_password']; - - if ($payment_gateway->test_mode == 1) { - $store_key = $keys['store_key']; - $store_password = $keys['store_password']; - $validation_url = "https://sandbox.sslcommerz.com"; - } else { - $store_key = $keys['store_live_key']; - $store_password = $keys['store_live_password']; - $validation_url = "https://securepay.sslcommerz.com"; - } - - $validation_url .= "/validator/api/validationserverAPI.php?val_id=" . $val_id . "&store_id=" . $store_key . "&store_passwd=" . $store_password . "&v=1&format=json"; - - $handle = curl_init(); - curl_setopt($handle, CURLOPT_URL, $validation_url); - curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); - curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); - - $result = curl_exec($handle); - - $code = curl_getinfo($handle, CURLINFO_HTTP_CODE); - - if ($code == 200 && ! (curl_errno($handle))) { - - $result = json_decode($result, true); - - if ($result['status'] == 'VALIDATED' || $result['status'] == 'VALID') { - - return true; - } - } - - return false; - - } - - public static function payment_create($identifier) - { - $payment_details = session('payment_details'); - $payment_gateway = DB::table('payment_gateways')->where('identifier', 'sslcommerz')->first(); - $user = DB::table('users')->where('id', auth()->user()->id)->first(); - $keys = json_decode($payment_gateway->keys, true); - - $products_name = ''; - foreach ($payment_details['items'] as $key => $value): - if ($key == 0) { - $products_name .= $value['title']; - } else { - $products_name .= ', ' . $value['title']; - } - endforeach; - - if ($payment_gateway->test_mode == 1): - $store_key = $keys['store_key']; - $store_password = $keys['store_password']; - $direct_api_url = "https://sandbox.sslcommerz.com/gwprocess/v3/api.php"; - else: - $store_key = $keys['store_live_key']; - $store_password = $keys['store_live_password']; - $direct_api_url = "https://securepay.sslcommerz.com/gwprocess/v3/api.php"; - endif; - - $post_data = array(); - $post_data['user_id'] = $user->id; - $post_data['payment_type'] = $identifier; - $post_data['items_id'] = $payment_details['items'][0]['id']; - $post_data['store_id'] = $store_key; - $post_data['store_passwd'] = $store_password; - $post_data['total_amount'] = round($payment_details['payable_amount']); - $post_data['currency'] = "BDT"; - $post_data['tran_id'] = "SSLCZ_TXN_" . uniqid(); - $post_data['success_url'] = $payment_details['success_url'] . '/' . $payment_gateway->identifier; - $post_data['fail_url'] = $payment_details['cancel_url']; - $post_data['cancel_url'] = $payment_details['cancel_url']; - - # CUSTOMER INFORMATION - $post_data['cus_name'] = $user->name; - $post_data['cus_email'] = $user->email; - $post_data['cus_add1'] = $user->address; - $post_data['cus_city'] = ""; - $post_data['cus_state'] = ""; - $post_data['cus_postcode'] = ""; - $post_data['cus_country'] = ""; - $post_data['cus_phone'] = $user->phone; - $post_data['cus_fax'] = ""; - - $handle = curl_init(); - curl_setopt($handle, CURLOPT_URL, $direct_api_url); - curl_setopt($handle, CURLOPT_TIMEOUT, 30); - curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 30); - curl_setopt($handle, CURLOPT_POST, 1); - curl_setopt($handle, CURLOPT_POSTFIELDS, $post_data); - curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); - curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); # KEEP IT FALSE IF YOU RUN FROM LOCAL PC - - $content = curl_exec($handle); - - $code = curl_getinfo($handle, CURLINFO_HTTP_CODE); - - $ssl_commerz_response = ""; - if ($code == 200 && ! (curl_errno($handle))) { - curl_close($handle); - $ssl_commerz_response = json_decode($content, true); - } else { - curl_close($handle); - - exit; - } - - return $ssl_commerz_response['GatewayPageURL']; - - } - -} diff --git a/database/migrations/2024_03_20_060240_create_offline_payments_table.php b/database/migrations/2024_03_20_060240_create_offline_payments_table.php deleted file mode 100644 index 236ebd7..0000000 --- a/database/migrations/2024_03_20_060240_create_offline_payments_table.php +++ /dev/null @@ -1,32 +0,0 @@ -id(); - $table->integer('user_id')->nullable(); - $table->string('items', 255)->nullable(); - $table->float('tax', 10, 2)->nullable(); - $table->float('total_amount', 10, 2)->nullable(); - $table->string('phone_on', 255)->nullable(); - $table->string('bank_no', 255)->nullable(); - $table->string('doc', 255)->nullable(); - $table->integer('status')->default(0); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void { - Schema::dropIfExists('offline_payments'); - } -}; diff --git a/public/assets/frontend/default/css/top-navbar.css b/public/assets/frontend/default/css/top-navbar.css index 5f66ae0..00d3271 100644 --- a/public/assets/frontend/default/css/top-navbar.css +++ b/public/assets/frontend/default/css/top-navbar.css @@ -30,6 +30,9 @@ height: 0px !important; min-height: 0px !important; } + #toggle-navigation { + display: none !important; + } } @@ -329,4 +332,4 @@ #top_menu { min-height: 50px; } -} \ No newline at end of file +} diff --git a/resources/views/admin/admin/permission.blade.php b/resources/views/admin/admin/permission.blade.php index a633134..6d0f600 100644 --- a/resources/views/admin/admin/permission.blade.php +++ b/resources/views/admin/admin/permission.blade.php @@ -37,7 +37,6 @@ 'admin.newsletter' => get_phrase('Newsletter'), 'admin.subscribed_user' => get_phrase('Newsletter Subscriber'), 'admin.contacts' => get_phrase('Contact User'), - 'admin.offline.payments' => get_phrase('Offline Payment'), 'admin.coupons' => get_phrase('Coupon'), 'admin.blogs' => get_phrase('Blog'), 'admin.pending.blog' => get_phrase('Pending Blog List'), diff --git a/resources/views/admin/header.blade.php b/resources/views/admin/header.blade.php index 7f50d64..fc89052 100644 --- a/resources/views/admin/header.blade.php +++ b/resources/views/admin/header.blade.php @@ -1,3 +1,11 @@ +
+ + + @include('components.home_made_by_developer.top_bar') +
- - @@ -70,7 +87,6 @@ - -
- - diff --git a/resources/views/admin/navigation.blade.php b/resources/views/admin/navigation.blade.php index ab19747..003f5a9 100644 --- a/resources/views/admin/navigation.blade.php +++ b/resources/views/admin/navigation.blade.php @@ -119,7 +119,7 @@ @endif --}} - @if (has_permission('admin.tutor_categories')) + {{-- @if (has_permission('admin.tutor_categories'))
- @endif + @endif --}} @if (has_permission('admin.enroll.history') || has_permission('admin.student.enroll'))
  • {{ get_phrase('Bootcamp') }}
  • {{--
  • {{ get_phrase('Team Training') }}
  • --}} -
  • {{ get_phrase('Find A Tutor') }}
  • + {{--
  • {{ get_phrase('Find A Tutor') }}
  • --}} diff --git a/resources/views/components/home_made_by_developer/header.blade.php b/resources/views/components/home_made_by_developer/header.blade.php index 02fe5f7..79230fd 100644 --- a/resources/views/components/home_made_by_developer/header.blade.php +++ b/resources/views/components/home_made_by_developer/header.blade.php @@ -82,7 +82,7 @@
  • {{ get_phrase('Bootcamp') }}
  • {{--
  • {{ get_phrase('Team Training') }}
  • --}} -
  • {{ get_phrase('Find A Tutor') }}
  • + {{--
  • {{ get_phrase('Find A Tutor') }}
  • --}} diff --git a/resources/views/frontend/default/bootcamp/bootcamp_grid.blade.php b/resources/views/frontend/default/bootcamp/bootcamp_grid.blade.php index cb7284b..3660504 100644 --- a/resources/views/frontend/default/bootcamp/bootcamp_grid.blade.php +++ b/resources/views/frontend/default/bootcamp/bootcamp_grid.blade.php @@ -99,18 +99,6 @@ $btn['title'] = get_phrase('In Collection'); $btn['url'] = route('my.bootcamp.details', $bootcamp->slug); } - - $pending_payment = DB::table('offline_payments') - ->where('user_id', auth()->user()->id) - ->where('item_type', 'bootcamp') - ->where('items', $bootcamp->id) - ->where('status', 0) - ->first(); - - if ($pending_payment) { - $btn['title'] = get_phrase('Processing'); - $btn['url'] = 'javascript:void(0);'; - } } @endphp where('bootcamp_id', $bootcamp_details->id) ->where('status', 1) ->exists(); - - $pending_bootcamp_payment = DB::table('offline_payments') - ->where('user_id', auth()->user()->id) - ->where('item_type', 'bootcamp') - ->where('items', $bootcamp_details->id) - ->where('status', 0) - ->first(); } @endphp diff --git a/resources/views/instructor/header.blade.php b/resources/views/instructor/header.blade.php index 4b509ab..1177b01 100644 --- a/resources/views/instructor/header.blade.php +++ b/resources/views/instructor/header.blade.php @@ -1,3 +1,11 @@ +
    + + + @include('components.home_made_by_developer.top_bar') +
    + + diff --git a/resources/views/instructor/navigation.blade.php b/resources/views/instructor/navigation.blade.php index 41a0c5d..74a4f72 100644 --- a/resources/views/instructor/navigation.blade.php +++ b/resources/views/instructor/navigation.blade.php @@ -63,29 +63,7 @@ - - - {{-- --}} - +{{-- - + --}}