v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -0,0 +1,93 @@
<?php
namespace Modules\PaypalStandard\Providers;
use Illuminate\Support\ServiceProvider as Provider;
use Modules\PaypalStandard\Listeners\ShowPaymentMethod;
class Main extends Provider
{
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->loadTranslations();
$this->loadViews();
$this->loadEvents();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->loadRoutes();
}
/**
* Load views.
*
* @return void
*/
public function loadViews()
{
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'paypal-standard');
}
/**
* Load translations.
*
* @return void
*/
public function loadTranslations()
{
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'paypal-standard');
}
/**
* Load events.
*
* @return void
*/
public function loadEvents()
{
$this->app['events']->listen(\App\Events\Module\PaymentMethodShowing::class, ShowPaymentMethod::class);
}
/**
* Load routes.
*
* @return void
*/
public function loadRoutes()
{
if (app()->routesAreCached()) {
return;
}
$routes = [
'guest.php',
'portal.php',
'signed.php',
];
foreach ($routes as $route) {
$this->loadRoutesFrom(__DIR__ . '/../Routes/' . $route);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}

View File

@ -1,90 +0,0 @@
<?php
namespace Modules\PaypalStandard\Providers;
use App\Events\PaymentGatewayListing;
use Illuminate\Support\ServiceProvider;
use Modules\PaypalStandard\Listeners\Gateway;
class PaypalStandardServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerViews();
$this->registerEvents();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/paypalstandard');
$sourcePath = __DIR__.'/../Resources/views';
$this->publishes([
$sourcePath => $viewPath
]);
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/paypalstandard';
}, \Config::get('view.paths')), [$sourcePath]), 'paypalstandard');
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/paypalstandard');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'paypalstandard');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'paypalstandard');
}
}
public function registerEvents()
{
$this->app['events']->listen(PaymentGatewayListing::class, Gateway::class);
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}