<?php

use Illuminate\Support\Facades\Event;
use Mtc\Plugins\Realex\Classes\Realex;

if (! defined('REALEX_ENABLED')) {
    require_once __DIR__ . '/install/install.php';
    header("Refresh:0");
    exit;
}

if (REALEX_ENABLED) {
    Event::listen('shop.checkout.load_payment_gateways', '\\' . Realex::class . '@form');
}


Route::any('realex/callback', [
    'as' => 'realex-callback',
    'uses' => 'Mtc\Plugins\Realex\Http\Controllers\RealexController@callback'
]);
