v2 first commit
This commit is contained in:
23
modules/OfflinePayments/Listeners/ShowPaymentMethod.php
Normal file
23
modules/OfflinePayments/Listeners/ShowPaymentMethod.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\OfflinePayments\Listeners;
|
||||
|
||||
use App\Events\Module\PaymentMethodShowing as Event;
|
||||
|
||||
class ShowPaymentMethod
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param Event $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
$methods = json_decode(setting('offline-payments.methods'), true);
|
||||
|
||||
foreach ($methods as $method) {
|
||||
$event->modules->payment_methods[] = $method;
|
||||
}
|
||||
}
|
||||
}
|
24
modules/OfflinePayments/Listeners/ShowSetting.php
Normal file
24
modules/OfflinePayments/Listeners/ShowSetting.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\OfflinePayments\Listeners;
|
||||
|
||||
use App\Events\Module\SettingShowing as Event;
|
||||
|
||||
class ShowSetting
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param Event $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
$event->modules->settings['offline-payments'] = [
|
||||
'name' => trans('offline-payments::general.name'),
|
||||
'description' => trans('offline-payments::general.description'),
|
||||
'url' => 'settings/offline-payments',
|
||||
'icon' => 'fas fa-credit-card',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user