fix: Double-charged shipping fee in Yoco payment + ops staff access
1. Fix Yoco payment amount calculation: order->total already includes shipping_fee, so don't add it again. Was charging 2x shipping. 2. Add authorization gate for ops staff access: users with is_admin=true can now access the ops page by scanning QR codes.
This commit is contained in:
@@ -30,5 +30,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
$cartCount = session('cart') ? count(session('cart')) : 0;
|
||||
$view->with('cartCount', $cartCount);
|
||||
});
|
||||
|
||||
// Authorization gates
|
||||
\Illuminate\Support\Facades\Gate::define('access-ops', function ($user) {
|
||||
// Allow admin users to access ops
|
||||
return $user->is_admin === true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user