Attendize/app/Http/Controllers/EventOrdersController.php

494 lines
16 KiB
PHP
Raw Normal View History

2016-02-29 15:59:36 +00:00
<?php
namespace App\Http\Controllers;
2016-03-22 15:31:18 +00:00
use App\Jobs\SendOrderTickets;
2016-03-05 00:18:10 +00:00
use App\Models\Attendee;
2016-02-29 15:59:36 +00:00
use App\Models\Event;
use App\Models\EventStats;
2016-02-29 15:59:36 +00:00
use App\Models\Order;
use App\Models\PaymentGateway;
use App\Services\Order as OrderService;
2019-09-16 13:56:59 +00:00
use Services\PaymentGateway\Factory as PaymentGatewayFactory;
2016-03-05 00:18:10 +00:00
use DB;
use Excel;
2016-09-06 20:39:27 +00:00
use Illuminate\Http\Request;
2016-03-05 00:18:10 +00:00
use Log;
use Mail;
2016-03-07 17:37:16 +00:00
use Omnipay;
2016-03-05 00:18:10 +00:00
use Validator;
2016-02-29 15:59:36 +00:00
class EventOrdersController extends MyBaseController
{
2016-03-22 15:31:18 +00:00
/**
* Show event orders page
*
* @param Request $request
* @param string $event_id
* @return mixed
*/
public function showOrders(Request $request, $event_id = '')
2016-02-29 15:59:36 +00:00
{
$allowed_sorts = ['first_name', 'email', 'order_reference', 'order_status_id', 'created_at'];
2016-03-22 15:31:18 +00:00
$searchQuery = $request->get('q');
2016-09-06 20:39:27 +00:00
$sort_by = (in_array($request->get('sort_by'), $allowed_sorts) ? $request->get('sort_by') : 'created_at');
$sort_order = $request->get('sort_order') == 'asc' ? 'asc' : 'desc';
2016-02-29 15:59:36 +00:00
$event = Event::scope()->find($event_id);
if ($searchQuery) {
/*
* Strip the hash from the start of the search term in case people search for
* order references like '#EDGC67'
*/
if ($searchQuery[0] === '#') {
$searchQuery = str_replace('#', '', $searchQuery);
}
$orders = $event->orders()
->where(function ($query) use ($searchQuery) {
2016-09-06 20:39:27 +00:00
$query->where('order_reference', 'like', $searchQuery . '%')
->orWhere('first_name', 'like', $searchQuery . '%')
->orWhere('email', 'like', $searchQuery . '%')
->orWhere('last_name', 'like', $searchQuery . '%');
2016-02-29 15:59:36 +00:00
})
->orderBy($sort_by, $sort_order)
->paginate();
} else {
$orders = $event->orders()->orderBy($sort_by, $sort_order)->paginate();
}
$data = [
2016-03-07 17:37:16 +00:00
'orders' => $orders,
'event' => $event,
'sort_by' => $sort_by,
2016-02-29 15:59:36 +00:00
'sort_order' => $sort_order,
2016-03-07 17:37:16 +00:00
'q' => $searchQuery ? $searchQuery : '',
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
return view('ManageEvent.Orders', $data);
2016-02-29 15:59:36 +00:00
}
2016-03-22 15:31:18 +00:00
/**
* Shows 'Manage Order' modal
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function manageOrder(Request $request, $order_id)
2016-02-29 15:59:36 +00:00
{
$order = Order::scope()->find($order_id);
$orderService = new OrderService($order->amount, $order->booking_fee, $order->event);
$orderService->calculateFinalCosts();
2016-02-29 15:59:36 +00:00
$data = [
'order' => $order,
'orderService' => $orderService
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
return view('ManageEvent.Modals.ManageOrder', $data);
2016-02-29 15:59:36 +00:00
}
/**
* Shows 'Edit Order' modal
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function showEditOrder(Request $request, $order_id)
{
$order = Order::scope()->find($order_id);
$data = [
'order' => $order,
'event' => $order->event(),
'attendees' => $order->attendees()->withoutCancelled()->get(),
'modal_id' => $request->get('modal_id'),
];
return view('ManageEvent.Modals.EditOrder', $data);
}
2016-03-22 15:31:18 +00:00
/**
* Shows 'Cancel Order' modal
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function showCancelOrder(Request $request, $order_id)
2016-02-29 15:59:36 +00:00
{
$order = Order::scope()->find($order_id);
$data = [
2016-03-07 17:37:16 +00:00
'order' => $order,
'event' => $order->event(),
2016-02-29 15:59:36 +00:00
'attendees' => $order->attendees()->withoutCancelled()->get(),
2016-03-22 15:31:18 +00:00
'modal_id' => $request->get('modal_id'),
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
return view('ManageEvent.Modals.CancelOrder', $data);
2016-02-29 15:59:36 +00:00
}
/**
* Resend an entire order
*
* @param $order_id
*
* @return \Illuminate\Http\JsonResponse
*/
public function resendOrder($order_id)
{
$order = Order::scope()->find($order_id);
$this->dispatch(new SendOrderTickets($order));
return response()->json([
'status' => 'success',
'redirectUrl' => '',
]);
}
/**
* Cancels an order
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function postEditOrder(Request $request, $order_id)
{
$rules = [
'first_name' => ['required'],
'last_name' => ['required'],
'email' => ['required', 'email'],
];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
return response()->json([
'status' => 'error',
'messages' => $validator->messages()->toArray(),
]);
}
$order = Order::scope()->findOrFail($order_id);
$order->first_name = $request->get('first_name');
$order->last_name = $request->get('last_name');
$order->email = $request->get('email');
$order->update();
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
\Session::flash('message', trans("Controllers.the_order_has_been_updated"));
return response()->json([
'status' => 'success',
'redirectUrl' => '',
]);
}
2016-02-29 15:59:36 +00:00
/**
2016-03-22 15:31:18 +00:00
* @param Request $request
* @param $order_id
* @return \Illuminate\Http\JsonResponse
* @throws \Exception
2016-02-29 15:59:36 +00:00
*/
2016-03-22 15:31:18 +00:00
public function postCancelOrder(Request $request, $order_id)
2016-02-29 15:59:36 +00:00
{
$rules = [
2016-03-05 00:18:10 +00:00
'refund_amount' => ['numeric'],
2016-02-29 15:59:36 +00:00
];
$messages = [
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
'refund_amount.integer' => trans("Controllers.refund_only_numbers_error"),
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
$validator = Validator::make($request->all(), $rules, $messages);
2016-02-29 15:59:36 +00:00
if ($validator->fails()) {
2016-03-22 15:31:18 +00:00
return response()->json([
2016-03-07 17:37:16 +00:00
'status' => 'error',
2016-03-05 00:18:10 +00:00
'messages' => $validator->messages()->toArray(),
]);
2016-02-29 15:59:36 +00:00
}
$order = Order::scope()->findOrFail($order_id);
2016-06-15 02:31:24 +00:00
2016-09-06 20:39:27 +00:00
$refund_order = ($request->get('refund_order') === 'on') ? true : false;
$refund_type = $request->get('refund_type');
2016-03-22 15:31:18 +00:00
$refund_amount = round(floatval($request->get('refund_amount')), 2);
2016-09-06 20:39:27 +00:00
$attendees = $request->get('attendees');
2016-03-05 00:18:10 +00:00
$error_message = false;
2016-02-29 15:59:36 +00:00
if ($refund_order && $order->payment_gateway->can_refund) {
2016-02-29 15:59:36 +00:00
if (!$order->transaction_id) {
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$error_message = trans("Controllers.order_cant_be_refunded");
2016-02-29 15:59:36 +00:00
}
if ($order->is_refunded) {
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$error_message = trans("Controllers.order_already_refunded");
} elseif ($order->organiser_amount == 0) {
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$error_message = trans("Controllers.nothing_to_refund");
2016-09-06 20:39:27 +00:00
} elseif ($refund_type !== 'full' && $refund_amount > round(($order->organiser_amount - $order->amount_refunded),
2)
) {
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$error_message = trans("Controllers.maximum_refund_amount", ["money"=>(money($order->organiser_amount - $order->amount_refunded,
$order->event->currency))]);
2016-02-29 15:59:36 +00:00
}
if (!$error_message) {
2016-02-29 15:59:36 +00:00
try {
$payment_gateway_config = $order->account->getGateway($order->payment_gateway->id)->config + [
'testMode' => config('attendize.enable_test_payments')];
$payment_gateway_factory = new PaymentGatewayFactory();
$gateway = $payment_gateway_factory->create($order->payment_gateway->name, $payment_gateway_config);
2016-02-29 15:59:36 +00:00
if ($refund_type === 'full') { /* Full refund */
$refund_amount = $order->organiser_amount - $order->amount_refunded;
2016-03-14 07:14:19 +00:00
}
$refund_application_fee = floatval($order->booking_fee) > 0 ? true : false;
$response = $gateway->refundTransaction($order, $refund_amount, $refund_application_fee);
2016-02-29 15:59:36 +00:00
if ($response['successful']) {
2016-03-14 07:14:19 +00:00
/* Update the event sales volume*/
$order->event->decrement('sales_volume', $refund_amount);
$order->amount_refunded = round(($order->amount_refunded + $refund_amount), 2);
2016-03-14 07:14:19 +00:00
if (($order->organiser_amount - $order->amount_refunded) == 0) {
$order->is_refunded = 1;
$order->order_status_id = config('attendize.order_refunded');
} else {
$order->is_partially_refunded = 1;
2016-03-14 07:14:19 +00:00
$order->order_status_id = config('attendize.order_partially_refunded');
2016-02-29 15:59:36 +00:00
}
2016-03-14 07:14:19 +00:00
} else {
$error_message = $response['error_message'];
2016-02-29 15:59:36 +00:00
}
2016-03-14 07:14:19 +00:00
2016-02-29 15:59:36 +00:00
$order->save();
} catch (\Exeption $e) {
2016-02-29 15:59:36 +00:00
Log::error($e);
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$error_message = trans("Controllers.refund_exception");
2016-02-29 15:59:36 +00:00
}
}
if ($error_message) {
2016-03-22 15:31:18 +00:00
return response()->json([
2016-03-07 17:37:16 +00:00
'status' => 'success',
2016-03-05 00:18:10 +00:00
'message' => $error_message,
2016-02-29 15:59:36 +00:00
]);
}
}
/*
* Cancel the attendees
*/
if ($attendees) {
foreach ($attendees as $attendee_id) {
$attendee = Attendee::scope()->where('id', '=', $attendee_id)->first();
$attendee->ticket->decrement('quantity_sold');
$attendee->ticket->decrement('sales_volume', $attendee->ticket->price);
$order->event->decrement('sales_volume', $attendee->ticket->price);
$order->decrement('amount', $attendee->ticket->price);
2016-02-29 15:59:36 +00:00
$attendee->is_cancelled = 1;
$attendee->save();
$eventStats = EventStats::where('event_id', $attendee->event_id)->where('date', $attendee->created_at->format('Y-m-d'))->first();
if($eventStats){
$eventStats->decrement('tickets_sold', 1);
$eventStats->decrement('sales_volume', $attendee->ticket->price);
}
2016-02-29 15:59:36 +00:00
}
}
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
if(!$refund_amount && !$attendees)
$msg = trans("Controllers.nothing_to_do");
else {
if($attendees && $refund_order)
$msg = trans("Controllers.successfully_refunded_and_cancelled");
else if($refund_order)
$msg = trans("Controllers.successfully_refunded_order");
else if($attendees)
$msg = trans("Controllers.successfully_cancelled_attendees");
}
\Session::flash('message', $msg);
2016-02-29 15:59:36 +00:00
2016-03-22 15:31:18 +00:00
return response()->json([
2016-03-07 17:37:16 +00:00
'status' => 'success',
2016-03-05 00:18:10 +00:00
'redirectUrl' => '',
2016-02-29 15:59:36 +00:00
]);
}
/**
2016-03-22 15:31:18 +00:00
* Exports order to popular file types
*
2016-02-29 15:59:36 +00:00
* @param $event_id
* @param string $export_as Accepted: xls, xlsx, csv, pdf, html
*/
public function showExportOrders($event_id, $export_as = 'xls')
{
$event = Event::scope()->findOrFail($event_id);
2016-09-06 20:39:27 +00:00
Excel::create('orders-as-of-' . date('d-m-Y-g.i.a'), function ($excel) use ($event) {
2016-02-29 15:59:36 +00:00
2016-09-06 20:39:27 +00:00
$excel->setTitle('Orders For Event: ' . $event->title);
2016-02-29 15:59:36 +00:00
// Chain the setters
$excel->setCreator(config('attendize.app_name'))
->setCompany(config('attendize.app_name'));
2016-02-29 15:59:36 +00:00
$excel->sheet('orders_sheet_1', function ($sheet) use ($event) {
\DB::connection()->setFetchMode(\PDO::FETCH_ASSOC);
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
$yes = strtoupper(trans("basic.yes"));
$no = strtoupper(trans("basic.no"));
2016-02-29 15:59:36 +00:00
$data = DB::table('orders')
->where('orders.event_id', '=', $event->id)
->where('orders.event_id', '=', $event->id)
->select([
'orders.first_name',
'orders.last_name',
'orders.email',
'orders.order_reference',
'orders.amount',
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
\DB::raw("(CASE WHEN orders.is_refunded = 1 THEN '$yes' ELSE '$no' END) AS `orders.is_refunded`"),
\DB::raw("(CASE WHEN orders.is_partially_refunded = 1 THEN '$yes' ELSE '$no' END) AS `orders.is_partially_refunded`"),
2016-02-29 15:59:36 +00:00
'orders.amount_refunded',
2016-03-05 00:18:10 +00:00
'orders.created_at',
2016-02-29 15:59:36 +00:00
])->get();
//DB::raw("(CASE WHEN UNIX_TIMESTAMP(`attendees.arrival_time`) = 0 THEN '---' ELSE 'd' END) AS `attendees.arrival_time`"))
$sheet->fromArray($data);
2016-06-15 02:31:24 +00:00
// Add headings to first row
2016-03-05 00:18:10 +00:00
$sheet->row(1, [
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
trans("Attendee.first_name"),
trans("Attendee.last_name"),
trans("Attendee.email"),
trans("Order.order_ref"),
trans("Order.amount"),
trans("Order.fully_refunded"),
trans("Order.partially_refunded"),
trans("Order.amount_refunded"),
trans("Order.order_date"),
2016-03-05 00:18:10 +00:00
]);
2016-02-29 15:59:36 +00:00
// Set gray background on first row
$sheet->row(1, function ($row) {
$row->setBackground('#f5f5f5');
});
});
})->export($export_as);
}
2016-03-22 15:31:18 +00:00
/**
* shows 'Message Order Creator' modal
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function showMessageOrder(Request $request, $order_id)
2016-02-29 15:59:36 +00:00
{
$order = Order::scope()->findOrFail($order_id);
$data = [
2016-09-06 20:39:27 +00:00
'order' => $order,
'event' => $order->event,
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
return view('ManageEvent.Modals.MessageOrder', $data);
2016-02-29 15:59:36 +00:00
}
2016-03-22 15:31:18 +00:00
/**
* Sends message to order creator
*
* @param Request $request
* @param $order_id
* @return mixed
*/
public function postMessageOrder(Request $request, $order_id)
2016-02-29 15:59:36 +00:00
{
$rules = [
'subject' => 'required|max:250',
2016-03-05 00:18:10 +00:00
'message' => 'required|max:5000',
2016-02-29 15:59:36 +00:00
];
2016-03-22 15:31:18 +00:00
$validator = Validator::make($request->all(), $rules);
2016-02-29 15:59:36 +00:00
if ($validator->fails()) {
2016-03-22 15:31:18 +00:00
return response()->json([
2016-03-07 17:37:16 +00:00
'status' => 'error',
2016-03-05 00:18:10 +00:00
'messages' => $validator->messages()->toArray(),
]);
2016-02-29 15:59:36 +00:00
}
$order = Order::scope()->findOrFail($order_id);
2016-02-29 15:59:36 +00:00
$data = [
2016-03-07 17:37:16 +00:00
'order' => $order,
2016-03-22 15:31:18 +00:00
'message_content' => $request->get('message'),
'subject' => $request->get('subject'),
2016-03-07 17:37:16 +00:00
'event' => $order->event,
'email_logo' => $order->event->organiser->full_logo_path,
2016-02-29 15:59:36 +00:00
];
2016-11-15 13:26:37 +00:00
Mail::send('Emails.messageReceived', $data, function ($message) use ($order, $data) {
2016-02-29 15:59:36 +00:00
$message->to($order->email, $order->full_name)
->from(config('attendize.outgoing_email_noreply'), $order->event->organiser->name)
2016-02-29 15:59:36 +00:00
->replyTo($order->event->organiser->email, $order->event->organiser->name)
->subject($data['subject']);
});
2016-06-15 02:31:24 +00:00
/* Send a copy to the Organiser with a different subject */
2016-03-22 15:31:18 +00:00
if ($request->get('send_copy') == '1') {
2016-11-15 13:26:37 +00:00
Mail::send('Emails.messageReceived', $data, function ($message) use ($order, $data) {
2016-02-29 15:59:36 +00:00
$message->to($order->event->organiser->email)
->from(config('attendize.outgoing_email_noreply'), $order->event->organiser->name)
2016-02-29 15:59:36 +00:00
->replyTo($order->event->organiser->email, $order->event->organiser->name)
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
->subject($data['subject'] . trans("Email.organiser_copy"));
2016-02-29 15:59:36 +00:00
});
}
2016-03-22 15:31:18 +00:00
return response()->json([
2016-03-07 17:37:16 +00:00
'status' => 'success',
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
'message' => trans("Controllers.message_successfully_sent"),
2016-03-05 00:18:10 +00:00
]);
2016-02-29 15:59:36 +00:00
}
/**
* Mark an order as payment received
*
* @param Request $request
* @param $order_id
* @return \Illuminate\Http\JsonResponse
*/
2016-09-06 20:39:27 +00:00
public function postMarkPaymentReceived(Request $request, $order_id)
{
$order = Order::scope()->findOrFail($order_id);
$order->is_payment_received = 1;
$order->order_status_id = 1;
$order->save();
(localization) Several big changes: 1) Added localization components to the package. They allow usage of localized routes, like http://attendize.site/en/login 2) Added English and Polish localization files. They are ugly, repetitive, but mostly true to the original and relevant. It required rewriting several phrases, and certainly required editing most of the views and controllers. 3) Edited routes to accomodate point 1 4) Rewritten several rules regarding dates. In most cases using English notation (with English names for months) is bad in all other languages. I used environment wide date format that is used. 5) Updated installer. Haven't tested it yet, but should work. Rewrites .env.example file instead of creating it from scratch (by concatenating strings). There are some minor changes that were simple fixes or other funky requirements from my employer that kinda make sense: 1) QR code reader wasn't working in firefox, fixed it. Works in chrome/firefox on mobile on https sites. 2) Added subscript text in some instances: below ticket registration, below ticket. It is kinda dumb, but in most cases is necessary to receive less complaints from clients. 3) Fixed geocoding api by adding api key in env file. At some point in 2016-2017 it was required by google to use API key from developer console and this requirement wasn't challenged in the code. 4) Ticket has been displaying either flyer or site logo on the side. Now displays both (which may affect 1d barcode - it might need some fixin). Regarding the same issue - description of an event contained the flyer image on the side, it was removed, cause it didn't fit in here. 5) Ticket style was updated, because of the above and because it didn't fit longer character strings. Now it's slightly uglier, but works in all cases. and other. There are also some inconveniences, like: 1) Unfinished translations. It was impossible for me to create translations based on strings located inside of a database, which I ignored (I think it's only at one place - surveys). 2) Ugly translation files. At some point I thought it is going to be easier to locate when I try translating vased by file name. Later I divided it by topics, and then I segmented it even more. It might require some serious clean-up. 3) Redundancy. In some cases there are several definitions for the same phrase in my localization files. I used it mostly to protect myself from different contexts for the phrase usage in different languages. 4) File division. There are several files that are placed in dedicated language directory (in /view/, like /view/pl/ or /view/en/). These files don't use language phrases, but they are translated as a whole. Mostly because using language phrases would make those view files unreadable. 5) Localzation helper marks some phrases as obsolete (in file "basic"), because they are used in app/Helpers folder (where this plugin doesn't reach)
2018-05-03 21:41:22 +00:00
session()->flash('message', trans("Controllers.order_payment_status_successfully_updated"));
return response()->json([
2016-09-06 20:39:27 +00:00
'status' => 'success',
]);
}
2016-02-29 15:59:36 +00:00
}