@@ -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 | ]); |
@@ -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,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function switchTicketState(Ticket $ticket) |
26 | 26 | { |
27 | - if($ticket->state == 'no_show') { |
|
27 | + if ($ticket->state == 'no_show') { |
|
28 | 28 | $ticket->state = 'consumed'; |
29 | 29 | } else { |
30 | 30 | $ticket->state = 'no_show'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | // On the first call of this function the event has not an associated boxoffice purchase. |
49 | 49 | // So we must create one. |
50 | - if(!$event->boxoffice) { |
|
50 | + if (!$event->boxoffice) { |
|
51 | 51 | $purchase = new Purchase(); |
52 | 52 | $purchase->generateSecrets(); |
53 | 53 | $purchase->customer_name = 'Box Office'; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | Ticket::where('purchase_id', $purchase->id)->delete(); |
69 | 69 | |
70 | 70 | // Freshly create the tickets sent for the box office |
71 | - foreach($request->tickets as $categoryId => $count) { |
|
71 | + foreach ($request->tickets as $categoryId => $count) { |
|
72 | 72 | for ($i = 0; $i < $count; $i++) { |
73 | 73 | Ticket::create([ |
74 | 74 | 'random_id' => Str::random(32), |
@@ -28,7 +28,7 @@ |
||
28 | 28 | 'tickets' => [ |
29 | 29 | 'required', |
30 | 30 | 'array', |
31 | - function ($attribute, $value, $fail) { |
|
31 | + function($attribute, $value, $fail) { |
|
32 | 32 | foreach ($value as $category => $count) { |
33 | 33 | if (!PriceCategory::find($category)) { |
34 | 34 | $fail('Please select only offered price categories!'); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function getLogo() |
37 | 37 | { |
38 | 38 | $logo = Setting::where('name', 'logo')->first(); |
39 | - if( $logo ) { |
|
39 | + if ($logo) { |
|
40 | 40 | return response()->file(Storage::path($logo->value)); |
41 | 41 | } else { |
42 | 42 | return redirect(asset('img/logos/fa-ticket.png')); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | // check if events are associate with the to be deleted project |
40 | 40 | // if yes do not delete and send back with errors |
41 | - if( $project->events()->exists() ) |
|
41 | + if ($project->events()->exists()) |
|
42 | 42 | { |
43 | 43 | return redirect()->route('admin.events.project.get', $project) |
44 | 44 | ->with('status', 'Error on deletion: Project has events!'); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | $projects = Project::where('is_archived', false)->get(); |
19 | 19 | $archive = Project::where('is_archived', true)->get(); |
20 | - foreach( $archive as $project ) |
|
20 | + foreach ($archive as $project) |
|
21 | 21 | { |
22 | 22 | // Set the time range of the project by selecting the last and first dates of its events |
23 | 23 | // if no events are associated with the project, set the dates to '-' |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | public function delete(Event $event) |
110 | 110 | { |
111 | - if($event->tickets()->exists()) |
|
111 | + if ($event->tickets()->exists()) |
|
112 | 112 | { |
113 | 113 | return redirect()->route('admin.events.get', $event) |
114 | 114 | ->with('status', 'Error on deletion: Event has tickets!'); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ->get(); |
64 | 64 | |
65 | 65 | // Iterate over all events and fill in the values for each fetched header |
66 | - foreach( $this->events as $event ) { |
|
66 | + foreach ($this->events as $event) { |
|
67 | 67 | $eventResults = []; |
68 | 68 | |
69 | 69 | $eventResults['date'] = $event->start_date; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ->count(); |
75 | 75 | |
76 | 76 | // Get ticket category stats |
77 | - foreach( $priceCategories as $cat) { |
|
77 | + foreach ($priceCategories as $cat) { |
|
78 | 78 | // Get the number of tickets sold of this category |
79 | 79 | $eventResults[$cat->name . '_total'] = with(clone $viewQuery)->where('tickets.event_id', $event->id) |
80 | 80 | ->where('purchases.state', 'paid') |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $eventResults['total_sum'] = with(clone $viewQuery)->where('tickets.event_id', $event->id)->sum('price_categories.price'); |
98 | 98 | |
99 | 99 | // Get the sales for each vendor |
100 | - foreach( $vendors as $vendor ) { |
|
100 | + foreach ($vendors as $vendor) { |
|
101 | 101 | $eventResults[$vendor->name . '_sum'] = with(clone $viewQuery)->where('tickets.event_id', $event->id) |
102 | 102 | ->where('purchases.vendor_id', $vendor->id) |
103 | 103 | ->sum('price_categories.price'); |
@@ -40,7 +40,7 @@ discard block |
||
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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if ($this->sofortApi->isError()) { |
54 | 54 | // SOFORT-API didn't accept the data |
55 | - foreach($this->sofortApi->getErrors() as $error) { |
|
55 | + foreach ($this->sofortApi->getErrors() as $error) { |
|
56 | 56 | Log::error($error); |
57 | 57 | } |
58 | 58 | throw new PaymentProviderException("SOFORT got errors..."); |