@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function boot() |
18 | 18 | { |
19 | - Blade::directive('time', function ($expression) { |
|
19 | + Blade::directive('time', function($expression) { |
|
20 | 20 | return "<?php echo strftime('%H:%M', date_create($expression)->getTimestamp()); ?>"; |
21 | 21 | }); |
22 | - Blade::directive('datetime', function ($expression) { |
|
22 | + Blade::directive('datetime', function($expression) { |
|
23 | 23 | return "<?php echo strftime('%A, %d.%m.%Y', date_create($expression)->getTimestamp()); ?>"; |
24 | 24 | }); |
25 | 25 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | public function register() |
33 | 33 | { |
34 | 34 | $this->app->bind('App\PaymentProvider\Klarna', function($app) { |
35 | - return new Klarna( config('paymentprovider.sofortConfigKey') ); |
|
35 | + return new Klarna(config('paymentprovider.sofortConfigKey')); |
|
36 | 36 | }); |
37 | 37 | |
38 | 38 | $this->app->bind('App\PaymentProvider\PayPal', function($app) { |
39 | 39 | return new PayPal( |
40 | - config('paymentprovider.payPalClientId'), // ClientID |
|
40 | + config('paymentprovider.payPalClientId'), // ClientID |
|
41 | 41 | config('paymentprovider.payPalClientSecret') // ClientSecret |
42 | 42 | ); |
43 | 43 | }); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $locale = $request->session()->get('locale', config('app.locale')); |
20 | 20 | App::setLocale($locale); |
21 | - if(config('app.locale_time')) { |
|
21 | + if (config('app.locale_time')) { |
|
22 | 22 | setlocale(LC_TIME, config('app.locale_time')); |
23 | 23 | } else { |
24 | 24 | setlocale(LC_TIME, $locale); |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | 'tickets' => [ |
28 | 28 | 'required', |
29 | 29 | 'array', |
30 | - function ($attribute, $value, $fail) { |
|
30 | + function($attribute, $value, $fail) { |
|
31 | 31 | // First check if the selected categories are linked |
32 | 32 | // to the selected event. Else attackers could select |
33 | 33 | // cheaper categories for their tickets |
34 | 34 | $event = $this->route('event'); |
35 | 35 | $allowedPriceCategories = $event->priceList->categories->pluck('id')->toArray(); |
36 | - $selectedCategoryIds = array_keys( $value ); |
|
36 | + $selectedCategoryIds = array_keys($value); |
|
37 | 37 | $notAllowedCategories = array_diff($selectedCategoryIds, $allowedPriceCategories); |
38 | - if(!empty($notAllowedCategories)) { |
|
38 | + if (!empty($notAllowedCategories)) { |
|
39 | 39 | $fail('Please only select offered price categories!'); |
40 | 40 | } |
41 | 41 | // Check if the ticket sum is between 1 and 8 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'sometimes', |
56 | 56 | 'required', |
57 | 57 | 'array', |
58 | - function ($attribute, $value, $fail) { |
|
58 | + function($attribute, $value, $fail) { |
|
59 | 59 | // We do not check if the amount of selected seats, because we already do this in the checks |
60 | 60 | // for the amount of tickets. Since the amount of tickets and seats |
61 | 61 | // has to be equal, the previous check implicits that the seats are |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | // Check if the seatIds are in the range of 1 - event's seats amount |
73 | - $validSeats = array_filter($value, function ($arrItem) use ($event) { |
|
73 | + $validSeats = array_filter($value, function($arrItem) use ($event) { |
|
74 | 74 | return $arrItem > 0 && $arrItem <= $event->seatMap->seats; |
75 | 75 | }); |
76 | 76 | if (count($validSeats) != $seatsSum) { |
@@ -41,10 +41,10 @@ |
||
41 | 41 | public function __construct($clientId, $clientSecret) |
42 | 42 | { |
43 | 43 | $this->apiContext = new ApiContext( |
44 | - new OAuthTokenCredential( $clientId, $clientSecret) |
|
44 | + new OAuthTokenCredential($clientId, $clientSecret) |
|
45 | 45 | ); |
46 | 46 | |
47 | - if(App::environment('prod')) { |
|
47 | + if (App::environment('prod')) { |
|
48 | 48 | $this->apiContext->setConfig([ |
49 | 49 | 'mode' => 'live' |
50 | 50 | ]); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $this->sofortApi->setAmount($purchase->total()); |
42 | 42 | $this->sofortApi->setCurrencyCode('EUR'); |
43 | - $this->sofortApi->setReason('#'.$purchase->id . ' Purchase'); |
|
43 | + $this->sofortApi->setReason('#' . $purchase->id . ' Purchase'); |
|
44 | 44 | $this->sofortApi->setSuccessUrl(route('ts.payment.successful', [ |
45 | 45 | 'purchase' => $purchase->random_id, |
46 | 46 | 'secret' => $purchase->payment_secret |
@@ -65,12 +65,12 @@ |
||
65 | 65 | $returnable->with('status', $e->getMessage()); |
66 | 66 | Log::warning($e); |
67 | 67 | } catch (PayPalConnectionException $e) { |
68 | - Log::warning('[PayPal] [paymentId='. $paymentId . '|payerId=' . $payerId . '] ' . $e->getMessage()); |
|
68 | + Log::warning('[PayPal] [paymentId=' . $paymentId . '|payerId=' . $payerId . '] ' . $e->getMessage()); |
|
69 | 69 | // This will print the detailed information on the exception. |
70 | 70 | //REALLY HELPFUL FOR DEBUGGING |
71 | 71 | Log::error($e->getData()); |
72 | 72 | } catch (\Exception $e) { |
73 | - Log::warning('[General] [paymentId='. $paymentId . '|payerId=' . $payerId . '] ' . $e->getMessage()); |
|
73 | + Log::warning('[General] [paymentId=' . $paymentId . '|payerId=' . $payerId . '] ' . $e->getMessage()); |
|
74 | 74 | } |
75 | 75 | return $returnable; |
76 | 76 | } |
@@ -24,10 +24,10 @@ |
||
24 | 24 | public function rules() |
25 | 25 | { |
26 | 26 | $filter = 'in:'; |
27 | - if(env('KLARNA_CONFIG_KEY')) { |
|
27 | + if (env('KLARNA_CONFIG_KEY')) { |
|
28 | 28 | $filter .= 'Klarna,'; |
29 | 29 | } |
30 | - if(env('PAYPAL_CLIENT_SECRET')) { |
|
30 | + if (env('PAYPAL_CLIENT_SECRET')) { |
|
31 | 31 | $filter .= 'PayPal,'; |
32 | 32 | } |
33 | 33 | return [ |