Skip to content

Commit 49671f6

Browse files
committed
applied new route macros and structure
1 parent cfc8e86 commit 49671f6

File tree

4 files changed

+34
-22
lines changed

4 files changed

+34
-22
lines changed

Resources/views/show.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<input type="hidden" name="no_note" value="1" />
4040
<input type="hidden" name="no_shipping" value="1" />
4141
<input type="hidden" name="charset" value="utf-8" />
42-
<input type="hidden" name="return" value="{{ route('portal.invoices.paypal-standard.return', $invoice->id) }}" />
43-
<input type="hidden" name="notify_url" value="{{ route('portal.invoices.paypal-standard.complete', $invoice->id) }}" />
42+
<input type="hidden" name="return" value="{{ route('portal.paypal-standard.invoices.return', $invoice->id) }}" />
43+
<input type="hidden" name="notify_url" value="{{ route('portal.paypal-standard.invoices.complete', $invoice->id) }}" />
4444
<input type="hidden" name="cancel_return" value="{{ $invoice_url }}" />
4545
<input type="hidden" name="paymentaction" value="{{ $setting['transaction'] }}" />
4646
<input type="hidden" name="custom" value="{{ $invoice->id }}" />

Routes/guest.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<?php
22

3-
Route::group([
4-
'prefix' => '{company_id}/portal',
5-
'middleware' => 'guest',
6-
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
7-
], function () {
8-
Route::post('invoices/{invoice}/paypal-standard/return', 'Payment@return')->name('portal.invoices.paypal-standard.return');
9-
Route::post('invoices/{invoice}/paypal-standard/complete', 'Payment@complete')->name('portal.invoices.paypal-standard.complete');
10-
});
3+
use Illuminate\Support\Facades\Route;
4+
5+
/**
6+
* 'guest' middleware and 'portal/paypal-standard' prefix applied to all routes (including names)
7+
*
8+
* @see \App\Providers\Route::register
9+
*/
10+
11+
Route::portal('paypal-standard', function () {
12+
Route::get('invoices/{invoice}/complete', 'Payment@return')->name('invoices.return');
13+
Route::post('invoices/{invoice}/complete', 'Payment@complete')->name('invoices.complete');
14+
}, ['middleware' => 'guest']);

Routes/portal.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22

3-
Route::group([
4-
'prefix' => '{company_id}/portal',
5-
'middleware' => 'portal',
6-
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
7-
], function () {
8-
Route::get('invoices/{invoice}/paypal-standard', 'Payment@show')->name('portal.invoices.paypal-standard.show');
3+
use Illuminate\Support\Facades\Route;
4+
5+
/**
6+
* 'portal' middleware and 'portal/paypal-standard' prefix applied to all routes (including names)
7+
*
8+
* @see \App\Providers\Route::register
9+
*/
10+
11+
Route::portal('paypal-standard', function () {
12+
Route::get('invoices/{invoice}', 'Payment@show')->name('invoices.show');
913
});

Routes/signed.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22

3-
Route::group([
4-
'prefix' => '{company_id}/signed',
5-
'middleware' => 'signed',
6-
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
7-
], function () {
8-
Route::get('invoices/{invoice}/paypal-standard', 'Payment@show')->name('signed.invoices.paypal-standard.show');
3+
use Illuminate\Support\Facades\Route;
4+
5+
/**
6+
* 'signed' middleware and 'signed/paypal-standard' prefix applied to all routes (including names)
7+
*
8+
* @see \App\Providers\Route::register
9+
*/
10+
11+
Route::signed('paypal-standard', function () {
12+
Route::get('invoices/{invoice}', 'Payment@show')->name('invoices.show');
913
});

0 commit comments

Comments
 (0)