Separated Checkout and Payment controllers, updates to checkout and payments
This commit is contained in:
@@ -24,13 +24,6 @@ Route::group(['middleware'=>['auth:api','role:wholesaler']], function() {
|
||||
Route::get('a/supplier_products',[ProductController::class,'api_supplier_products']);
|
||||
});
|
||||
|
||||
// Reseller API calls
|
||||
Route::group(['middleware'=>['auth:api','role:reseller']], function() {
|
||||
Route::post('r/invoices/{o}',[AdminController::class,'pay_invoices'])
|
||||
->where('o','[0-9]+')
|
||||
->middleware(['theme:adminlte-be','role:wholesaler']);
|
||||
});
|
||||
|
||||
Route::group(['middleware'=>'auth:api'], function() {
|
||||
Route::post('/u/checkout/fee/{o}',[CheckoutController::class,'fee'])
|
||||
->where('o','[0-9]+');
|
||||
|
@@ -12,6 +12,7 @@ use App\Http\Controllers\{AdminController,
|
||||
HomeController,
|
||||
InvoiceController,
|
||||
OrderController,
|
||||
PaymentController,
|
||||
PaypalController,
|
||||
ProductController,
|
||||
SearchController,
|
||||
@@ -81,9 +82,11 @@ Route::group(['middleware'=>['auth','role:wholesaler'],'prefix'=>'a'],function()
|
||||
Route::post('setup',[AdminController::class,'setup']);
|
||||
|
||||
// Checkout Setup (Payments)
|
||||
Route::get('checkout',[CheckoutController::class,'home']);
|
||||
Route::get('checkout/{o?}',[CheckoutController::class,'view'])
|
||||
->where('o','[0-9]+');
|
||||
Route::model('co',\App\Models\Checkout::class);
|
||||
Route::view('checkout','theme.backend.adminlte.checkout.choose');
|
||||
Route::view('checkout/new','theme.backend.adminlte.checkout.view');
|
||||
Route::view('checkout/{co}','theme.backend.adminlte.checkout.view')
|
||||
->where('co','[0-9]+');
|
||||
Route::post('checkout/{o?}',[CheckoutController::class,'addedit'])
|
||||
->where('o','[0-9]+');
|
||||
|
||||
@@ -121,10 +124,6 @@ Route::group(['middleware'=>['auth','role:wholesaler'],'prefix'=>'a'],function()
|
||||
Route::get('report/products',[ReportController::class,'products']);
|
||||
Route::view('report/services','theme.backend.adminlte.service.report');
|
||||
|
||||
// Payments - @todo This should probably go to resellers
|
||||
Route::match(['get','post'],'payment/addedit/{o?}',[AdminController::class,'pay_addedit']);
|
||||
Route::get('payment/unapplied',[AdminController::class,'pay_unapplied']);
|
||||
|
||||
// Services
|
||||
// @todo This should probably go to resellers - implement a change audit log first
|
||||
Route::post('service/update/{o}',[ServiceController::class,'update'])
|
||||
@@ -150,12 +149,23 @@ Route::group(['middleware'=>['auth','role:reseller'],'prefix'=>'r'],function() {
|
||||
Route::get('hosting',[ServiceController::class,'hosting_list']);
|
||||
});
|
||||
|
||||
Route::post('account/invoices',[InvoiceController::class,'api_account_invoices']);
|
||||
|
||||
// Charges
|
||||
Route::post('charge/addedit',[ChargeController::class,'addedit']);
|
||||
Route::post('charge/delete/{o}',[ChargeController::class,'delete'])
|
||||
->where('o','[0-9]+');
|
||||
Route::post('charge/edit',[ChargeController::class,'edit']);
|
||||
|
||||
// Payments
|
||||
Route::model('po',\App\Models\Payment::class);
|
||||
Route::view('payment/new','theme.backend.adminlte.payment.view');
|
||||
Route::view('payment/{po}','theme.backend.adminlte.payment.view')
|
||||
->where('po','[0-9]+');
|
||||
Route::post('payment/{o?}',[PaymentController::class,'addedit'])
|
||||
->where('o','[0-9]+');
|
||||
Route::view('payment/unapplied','theme.backend.adminlte.payment.unapplied');
|
||||
|
||||
// Reseller API calls
|
||||
Route::post('service_change_charges/{o}',[ServiceController::class,'service_change_charges_display'])
|
||||
->where('o','[0-9]+');
|
||||
@@ -170,7 +180,7 @@ Route::group(['middleware'=>['auth'],'prefix'=>'u'],function() {
|
||||
Route::get('home/{o}',[HomeController::class,'home'])
|
||||
->where('o','[0-9]+')
|
||||
->middleware('can:view,o');
|
||||
Route::post('checkout/pay',[CheckoutController::class,'pay']);
|
||||
Route::redirect('checkout/pay','pay/paypal/authorise');
|
||||
Route::get('invoice/{o}',[InvoiceController::class,'view'])
|
||||
->where('o','[0-9]+')
|
||||
->middleware('can:view,o');
|
||||
|
Reference in New Issue
Block a user