|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | +use Excent\BePaidLaravel\Http\Controllers\BePaidController; |
3 | 4 | use Illuminate\Support\Facades\Route;
|
4 | 5 |
|
5 |
| -$config = config('bepaid'); |
| 6 | +$config = config('bepaid.urls'); |
6 | 7 |
|
7 |
| -Route::group([ |
8 |
| - 'namespace' => 'Excent\BePaidLaravel\Http\Controllers', |
9 |
| - 'prefix' => 'bepaid', |
10 |
| -], function () use ($config) { |
11 |
| - Route::post($config['urls']['notifications']['path'], [ |
12 |
| - 'uses' => 'BePaidController@notification', |
13 |
| - 'as' => $config['urls']['notifications']['name'], |
14 |
| - ])->middleware(array_unique(array_merge(['bepaid.inject_basic_auth'], $config['middlewares']))); |
15 |
| - Route::get($config['urls']['cancel']['path'], [ |
16 |
| - 'uses' => 'BePaidController@cancel', |
17 |
| - 'as' => $config['urls']['cancel']['name'], |
18 |
| - ])->middleware($config['middlewares']); |
19 |
| - Route::get($config['urls']['decline']['path'], [ |
20 |
| - 'uses' => 'BePaidController@decline', |
21 |
| - 'as' => $config['urls']['decline']['name'], |
22 |
| - ])->middleware($config['middlewares']); |
23 |
| - Route::get($config['urls']['success']['path'], [ |
24 |
| - 'uses' => 'BePaidController@success', |
25 |
| - 'as' => $config['urls']['success']['name'], |
26 |
| - ])->middleware($config['middlewares']); |
27 |
| - Route::get($config['urls']['fail']['path'], [ |
28 |
| - 'uses' => 'BePaidController@fail', |
29 |
| - 'as' => $config['urls']['fail']['name'], |
30 |
| - ])->middleware($config['middlewares']); |
31 |
| - Route::get($config['urls']['return']['path'], [ |
32 |
| - 'uses' => 'BePaidController@return', |
33 |
| - 'as' => $config['urls']['return']['name'], |
34 |
| - ])->middleware($config['middlewares']); |
| 8 | +Route::post($config['notifications']['path'], [BePaidController::class, 'notification']) |
| 9 | + ->middleware(array_unique(array_merge(['bepaid.inject_basic_auth'], config('bepaid.middlewares')))) |
| 10 | + ->name($config['notifications']['name']); |
| 11 | + |
| 12 | +Route::middleware(config('bepaid.middlewares'))->group(function () use ($config) { |
| 13 | + Route::get($config['cancel']['path'], [BePaidController::class, 'cancel'])->name($config['cancel']['name']); |
| 14 | + Route::get($config['decline']['path'], [BePaidController::class, 'decline'])->name($config['decline']['name']); |
| 15 | + Route::get($config['success']['path'], [BePaidController::class, 'success'])->name($config['success']['name']); |
| 16 | + Route::get($config['fail']['path'], [BePaidController::class, 'fail'])->name($config['fail']['name']); |
| 17 | + Route::get($config['return']['path'], [BePaidController::class, 'return',])->name($config['return']['name']); |
35 | 18 | });
|
0 commit comments