UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_9647c319ece9
/
app
/
Helpers
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
CartHelper.php
<?php namespace EstudioLMS\Helpers; use EstudioLMS\Repositories\Courses\Course\CourseRepository; use EstudioLMS\Services\Admin\ConfigurationServices; use Illuminate\Contracts\Auth\Guard; use Lang; /** * Class CartHelper * @package EstudioLMS\Helpers */ class CartHelper { /** * @var CourseRepository */ private $courseRepository; /** * @var Guard */ private $auth; /** * @var ConfigurationServices */ private $configurationServices; /** * CartHelper constructor. * @param CourseRepository $courseRepository * @param Guard $auth * @param ConfigurationServices $configurationServices */ public function __construct( CourseRepository $courseRepository, Guard $auth, ConfigurationServices $configurationServices ) { $this->courseRepository = $courseRepository; $this->auth = $auth; $this->configurationServices = $configurationServices; } /** * @param $cart * @return string */ public function gatewayAvailable($cart) { $gateways = $this->courseRepository->find($cart->get('course_id'))->gateways()->get(); $html = ''; foreach ($gateways as $key => $value) { if ($this->configurationServices->validateGateways($value->title)) { $html .= '<div class="pull-right">'; $html .= '<a href="' . route($value->route) . '"'; $html .= 'id="' . $value->title . '"'; $html .= 'class="btn btn-success btn-lg">' . Lang::get($value->lang_title) . '</a>'; $html .= '</div>'; } } return $html; } //Helper da lista dos gateways do novo checkout /** * @param $cart * @return string */ public function gatewayAvailableNewCheckoutList($cart) { $gateways = $this->courseRepository->find($cart->get('course_id'))->gateways()->get(); $html = ''; $active = 'active'; foreach ($gateways as $key => $value) { if ($this->configurationServices->validateGateways($value->title)) { $html .= '<li role="presentation">'; $html .= '<a href="#' . $value->id . '" aria-controls="' . $value->id . '" role="tab" data-toggle="tab"'; $html .= 'class="' . $active . '">' . Lang::get($value->lang_title) . ''; $html .= '</a>'; $html .= '</li>'; } $active = ''; } return $html; } //Helper do conteúdo e botões dos gateways do novo checkout /** * @param $cart * @param null $cards * @param bool $needComplement * @return string * @throws \Throwable */ public function gatewayAvailableNewCheckoutButton($cart, $cards = null, $needComplement = false) { $user = $this->auth->user(); $gateways = $this->courseRepository->find($cart->get('course_id'))->gateways()->get(); $course = $this->courseRepository->find($cart->get('course_id')); $html = ''; $active = 'active'; foreach ($gateways as $key => $value) { if ($this->configurationServices->validateGateways($value->title)) { $html .= '<div role="tabpanel" class="tab-pane ' . $active . '" id="' . $value->id . '">'; $html .= '<div class="panel panel-default">'; $html .= '<div class="panel-body">'; if ($value->id == 1) { $html .= view('checkout.partials.__pagarme', compact('cards', 'installments', 'needComplement'))->render(); } elseif ($value->id == 2) { $html .= '<h4>Fique atento(a) aos detalhes:</h4>'; $html .= '<ul>'; $html .= trans("site_cart.textPaypal"); $html .= '</ul>'; } elseif ($value->id == 3) { $html .= '<h4>Fique atento(a) aos detalhes:</h4>'; $html .= '<ul>'; $html .= trans("site_cart.textPagseguro"); $html .= '</ul>'; } elseif ($value->id == 4) { if ($needComplement) { $html .= '<div class="alert alert-danger">Para contratar o curso, utilizando esse metódo de pagamento, é necessário <a href="' . route('checkout.shipping') . '">preencher os dados complementares</a></div>'; } else { $html .= '<div class="alert alert-success" style="margin-top: 10px;">' . $user->address->street . '... <a href=" ' . route('checkout.shipping') . '">Editar dados</a></div>'; } $html .= '<h4>Fique atento(a) aos detalhes:</h4>'; $html .= '<ul>'; $html .= trans("site_cart.textBillet"); $html .= '</ul>'; } $html .= '<br>'; if ($value->id == 1) { $html .= ''; } elseif ($value->id == 5) { $html .= '<a href="' . $course->url_hotmart . '" class="cart' . $value->id . ' btn btn-success btn-lg btn-block" id="btn-payment">Pagar com ' . Lang::get($value->lang_title) . '</a>'; } else { $html .= '<a href="' . route($value->route) . '" class="cart' . $value->id . ' btn btn-success btn-lg btn-block" id="btn-payment">Pagar com ' . Lang::get($value->lang_title) . '</a>'; } $html .= '</div>'; $html .= '</div>'; $html .= '</div>'; } $active = ''; } return $html; } }
Copyright © 2026 - UnknownSec