Skip to content

Commit

Permalink
applied new route macros and structure
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Apr 16, 2021
1 parent cfc8e86 commit 49671f6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Resources/views/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="return" value="{{ route('portal.invoices.paypal-standard.return', $invoice->id) }}" />
<input type="hidden" name="notify_url" value="{{ route('portal.invoices.paypal-standard.complete', $invoice->id) }}" />
<input type="hidden" name="return" value="{{ route('portal.paypal-standard.invoices.return', $invoice->id) }}" />
<input type="hidden" name="notify_url" value="{{ route('portal.paypal-standard.invoices.complete', $invoice->id) }}" />
<input type="hidden" name="cancel_return" value="{{ $invoice_url }}" />
<input type="hidden" name="paymentaction" value="{{ $setting['transaction'] }}" />
<input type="hidden" name="custom" value="{{ $invoice->id }}" />
Expand Down
20 changes: 12 additions & 8 deletions Routes/guest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php

Route::group([
'prefix' => '{company_id}/portal',
'middleware' => 'guest',
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
], function () {
Route::post('invoices/{invoice}/paypal-standard/return', 'Payment@return')->name('portal.invoices.paypal-standard.return');
Route::post('invoices/{invoice}/paypal-standard/complete', 'Payment@complete')->name('portal.invoices.paypal-standard.complete');
});
use Illuminate\Support\Facades\Route;

/**
* 'guest' middleware and 'portal/paypal-standard' prefix applied to all routes (including names)
*
* @see \App\Providers\Route::register
*/

Route::portal('paypal-standard', function () {
Route::get('invoices/{invoice}/complete', 'Payment@return')->name('invoices.return');
Route::post('invoices/{invoice}/complete', 'Payment@complete')->name('invoices.complete');
}, ['middleware' => 'guest']);
16 changes: 10 additions & 6 deletions Routes/portal.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php

Route::group([
'prefix' => '{company_id}/portal',
'middleware' => 'portal',
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
], function () {
Route::get('invoices/{invoice}/paypal-standard', 'Payment@show')->name('portal.invoices.paypal-standard.show');
use Illuminate\Support\Facades\Route;

/**
* 'portal' middleware and 'portal/paypal-standard' prefix applied to all routes (including names)
*
* @see \App\Providers\Route::register
*/

Route::portal('paypal-standard', function () {
Route::get('invoices/{invoice}', 'Payment@show')->name('invoices.show');
});
16 changes: 10 additions & 6 deletions Routes/signed.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php

Route::group([
'prefix' => '{company_id}/signed',
'middleware' => 'signed',
'namespace' => 'Modules\PaypalStandard\Http\Controllers'
], function () {
Route::get('invoices/{invoice}/paypal-standard', 'Payment@show')->name('signed.invoices.paypal-standard.show');
use Illuminate\Support\Facades\Route;

/**
* 'signed' middleware and 'signed/paypal-standard' prefix applied to all routes (including names)
*
* @see \App\Providers\Route::register
*/

Route::signed('paypal-standard', function () {
Route::get('invoices/{invoice}', 'Payment@show')->name('invoices.show');
});

0 comments on commit 49671f6

Please sign in to comment.