1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license MIT, http://opensource.org/licenses/MIT |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2016 |
6
|
|
|
* @package laravel |
7
|
|
|
* @subpackage Controller |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
namespace Aimeos\Shop\Controller; |
12
|
|
|
|
13
|
|
|
use Aimeos\Shop\Facades\Shop; |
14
|
|
|
use Illuminate\Routing\Controller; |
15
|
|
|
use Illuminate\Support\Facades\Response; |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Aimeos controller for checkout related functionality. |
20
|
|
|
* |
21
|
|
|
* @package laravel |
22
|
|
|
* @subpackage Controller |
23
|
|
|
*/ |
24
|
|
|
class CheckoutController extends Controller |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Returns the html for the checkout confirmation page. |
28
|
|
|
* |
29
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
30
|
|
|
*/ |
31
|
|
|
public function confirmAction() |
32
|
|
|
{ |
33
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-confirm' ) as $name ) |
34
|
|
|
{ |
35
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->getHeader(); |
|
|
|
|
36
|
|
|
$params['aibody'][$name] = Shop::get( $name )->getBody(); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
return Response::view('shop::checkout.confirm', $params)->header('Cache-Control', 'no-store'); |
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Returns the html for the standard checkout page. |
45
|
|
|
* |
46
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
47
|
|
|
*/ |
48
|
|
|
public function indexAction() |
49
|
|
|
{ |
50
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-index' ) as $name ) |
51
|
|
|
{ |
52
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->getHeader(); |
|
|
|
|
53
|
|
|
$params['aibody'][$name] = Shop::get( $name )->getBody(); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
return Response::view('shop::checkout.index', $params)->header('Cache-Control', 'no-store'); |
|
|
|
|
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Returns the view for the order update page. |
62
|
|
|
* |
63
|
|
|
* @return \Illuminate\Http\Response Response object with output and headers |
64
|
|
|
*/ |
65
|
|
|
public function updateAction() |
66
|
|
|
{ |
67
|
|
|
foreach( app( 'config' )->get( 'shop.page.checkout-update' ) as $name ) |
68
|
|
|
{ |
69
|
|
|
$params['aiheader'][$name] = Shop::get( $name )->getHeader(); |
|
|
|
|
70
|
|
|
$params['aibody'][$name] = Shop::get( $name )->getBody(); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
return Response::view('shop::checkout.update', $params)->header('Cache-Control', 'no-store'); |
|
|
|
|
74
|
|
|
} |
75
|
|
|
} |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.