Skip to content

Commit 02e1a48

Browse files
committed
Separate checkout confirm route for headless distribution
1 parent fb87353 commit 02e1a48

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

config/shop.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// 'jsonapi' => ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
1818
// 'account' => ['prefix' => 'profile', 'middleware' => ['web', 'auth']],
1919
// 'default' => ['prefix' => 'shop', 'middleware' => ['web']],
20+
// 'confirm' => ['prefix' => 'shop', 'middleware' => ['web']],
2021
// 'supplier' => ['prefix' => 's', 'middleware' => ['web']],
2122
// 'page' => ['prefix' => 'p', 'middleware' => ['web']],
2223
// 'home' => ['middleware' => ['web']],

routes/aimeos.php

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,6 @@
155155
}
156156

157157

158-
if( ( $conf = config( 'shop.routes.update', [] ) ) !== false ) {
159-
160-
Route::group( $conf, function() {
161-
162-
Route::match( array( 'GET', 'POST' ), 'update', array(
163-
'as' => 'aimeos_shop_update',
164-
'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction'
165-
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
166-
167-
});
168-
}
169-
170-
171158
if( ( $conf = config( 'shop.routes.account', ['prefix' => 'profile', 'middleware' => ['web', 'auth']] ) ) !== false ) {
172159

173160
Route::group( $conf, function() {
@@ -209,6 +196,32 @@
209196
}
210197

211198

199+
if( ( $conf = config( 'shop.routes.update', [] ) ) !== false ) {
200+
201+
Route::group( $conf, function() {
202+
203+
Route::match( array( 'GET', 'POST' ), 'update', array(
204+
'as' => 'aimeos_shop_update',
205+
'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction'
206+
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
207+
208+
});
209+
}
210+
211+
212+
if( ( $conf = config( 'shop.routes.confirm', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) {
213+
214+
Route::group( $conf, function() {
215+
216+
Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array(
217+
'as' => 'aimeos_shop_confirm',
218+
'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction'
219+
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
220+
221+
});
222+
}
223+
224+
212225
if( ( $conf = config( 'shop.routes.default', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) {
213226

214227
Route::group( $conf, function() {
@@ -238,11 +251,6 @@
238251
'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction'
239252
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
240253

241-
Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array(
242-
'as' => 'aimeos_shop_confirm',
243-
'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction'
244-
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
245-
246254
Route::match( array( 'GET', 'POST' ), 'pin', array(
247255
'as' => 'aimeos_shop_session_pinned',
248256
'uses' => 'Aimeos\Shop\Controller\CatalogController@sessionAction'

tests/AimeosTestAbstract.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected function getEnvironmentSetUp( $app )
5353
$app['config']->set( 'shop.routes.jsonapi', ['prefix' => '{site}/jsonapi'] );
5454
$app['config']->set( 'shop.routes.account', ['prefix' => '{site}/profile'] );
5555
$app['config']->set( 'shop.routes.default', ['prefix' => '{site}/shop'] );
56+
$app['config']->set( 'shop.routes.confirm', ['prefix' => '{site}/shop'] );
5657
$app['config']->set( 'shop.routes.update', ['prefix' => '{site}'] );
5758
$app['config']->set( 'shop.routes.page', ['prefix' => '{site}/p'] );
5859
$app['config']->set( 'shop.routes.login', [] );

0 commit comments

Comments
 (0)