fixes
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InvoicePaymentController extends Controller
|
||||
@@ -14,18 +15,21 @@ class InvoicePaymentController extends Controller
|
||||
return $dataTable->render('Admin.Shop.InvoicePayments.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
public function create($invoice_id)
|
||||
{
|
||||
$data = InvoicePayments::init();
|
||||
$data['invoice_id'] = $invoice_id;
|
||||
|
||||
return view('Admin.Shop.InvoicePayments.create', $data);
|
||||
return view('Admin.Shop.InvoicePayments.form', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = InvoicePayments::store($request->all());
|
||||
$data = $request->all();
|
||||
$ret = InvoicePayments::store($data);
|
||||
Invoices::checkPayments($data['invoice_id']);
|
||||
|
||||
return redirect()->route('Admin.Shop.InvoicePayments.index');
|
||||
return redirect()->route('Admin.Shop.Invoices.edit', ['id' => $request->input('invoice_id')]);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
@@ -40,12 +44,15 @@ class InvoicePaymentController extends Controller
|
||||
{
|
||||
$data = InvoicePayments::init();
|
||||
$data['invoice_payment'] = InvoicePayments::getArray($id);
|
||||
$data['invoice_id'] = $data['invoice_payment']['invoice_id'];
|
||||
|
||||
return view('Admin.Shop.InvoicePayments.edit', $data);
|
||||
return view('Admin.Shop.InvoicePayments.form', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return InvoicePayments::destroy($id);
|
||||
$payment = InvoicePayments::get($id);
|
||||
InvoicePayments::destroy($id);
|
||||
Invoices::checkPayments($payment->invoice_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Sebastienheyd\Boilerplate\Rules\Password;
|
||||
|
||||
|
||||
class RegisterController extends Controller
|
||||
@@ -24,14 +23,6 @@ class RegisterController extends Controller
|
||||
|
||||
public function register(RegisterCustomer $request)
|
||||
{
|
||||
$request->validateWithBag('Errors', [
|
||||
'last_name' => 'required|max:255',
|
||||
'first_name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:shop_customers,email,NULL,id,deleted_at,NULL',
|
||||
'password' => ['required', 'confirmed', new Password()],
|
||||
|
||||
]);
|
||||
|
||||
if (back()->getTargetUrl() === route('Shop.Orders.store')) {
|
||||
$route = 'Shop.Orders.order';
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -54,4 +55,11 @@ class CustomerController extends Controller
|
||||
|
||||
return redirect()->route('Shop.Customers.edit');
|
||||
}
|
||||
|
||||
public function delete_address($id)
|
||||
{
|
||||
$ret = CustomerAddresses::destroy($id);
|
||||
|
||||
return redirect()->route('Shop.Customers.edit');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Datatables\Shop\CustomerOrdersDataTable;
|
||||
use App\Http\Requests\Shop\StoreOrderPost;
|
||||
use App\Repositories\Core\User\ShopCart;
|
||||
use App\Repositories\Shop\Baskets;
|
||||
use App\Repositories\Shop\Contents;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Repositories\Shop\Deliveries;
|
||||
use App\Repositories\Shop\DeliveryTypes;
|
||||
@@ -61,13 +63,14 @@ class OrderController extends Controller
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(StoreOrderPost $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$data['customer_id'] = Customers::getId();
|
||||
$data['sale_channel_id'] = $data['sale_channel_id'] ?? SaleChannels::getDefaultID();
|
||||
$data['basket'] = Baskets::getBasketSummary($data['sale_channel_id'], $data['delivery_type_id'] ?? false);
|
||||
$order = Orders::saveOrder($data);
|
||||
|
||||
if ($order) {
|
||||
if ($data['payment_type'] === '1') {
|
||||
return Paybox::makeAuthorizationRequest($order);
|
||||
@@ -83,8 +86,9 @@ class OrderController extends Controller
|
||||
public function confirmed()
|
||||
{
|
||||
ShopCart::clear();
|
||||
$content = Contents::getOrderConfirmedContent();
|
||||
|
||||
return view('Shop.Orders.confirmed');
|
||||
return view('Shop.Orders.confirmed', ['content' => $content]);
|
||||
}
|
||||
|
||||
public function getPdf($uuid)
|
||||
|
||||
@@ -3,38 +3,33 @@
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Contents;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PayboxController extends Controller
|
||||
{
|
||||
public function accepted()
|
||||
{
|
||||
return view('paybox.accepted');
|
||||
return view('paybox.paybox', ['content' => Contents::getPayboxConfirmedContent()]);
|
||||
}
|
||||
|
||||
public function refused(Request $request)
|
||||
{
|
||||
dump($request->all());
|
||||
exit;
|
||||
|
||||
return view('paybox.refused');
|
||||
return view('paybox.paybox', ['content' => Contents::getPayboxRefusedContent()]);
|
||||
}
|
||||
|
||||
public function aborted()
|
||||
{
|
||||
return view('paybox.aborted');
|
||||
return view('paybox.paybox', ['content' => Contents::getPayboxAbortedContent()]);
|
||||
}
|
||||
|
||||
public function waiting()
|
||||
{
|
||||
return view('paybox.waiting');
|
||||
return view('paybox.waiting', ['content' => Contents::getPayboxWaitingContent()]);
|
||||
}
|
||||
|
||||
public function process(Request $request)
|
||||
{
|
||||
dump($request);
|
||||
exit;
|
||||
|
||||
return view('paybox.send');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user