Add Stripe terminal and department variables API endpoints

This update introduces new endpoints for managing Stripe terminal readers, locations, and department-specific configurations. It also adds support for creating, updating, and retrieving department variables along with enhanced validation, logging, and permission checks. These updates improve integration and expand functionality for Stripe and department-related operations.
This commit is contained in:
Jepp9350
2025-02-21 14:43:33 +01:00
parent ff12fbcbd0
commit d2c1cdda9a
9 changed files with 670 additions and 37 deletions
@@ -97,12 +97,14 @@ class authentication implements authentication_i
{
// Get the token from the headers
$headers = getallheaders();
if (!isset($headers['Authorization'])) {
if (!isset($headers['Authorization']) && !isset($_GET['token'])) {
return false;
}
$token = $headers['Authorization'];
// Strip the Bearer prefix
$token = str_replace('Bearer ', '', $token);
$token = $_GET['token'] ?? $headers['Authorization'];
// Strip the Bearer prefix (If the token is from the headers)
if (isset($headers['Authorization'])) {
$token = str_replace('Bearer ', '', $token);
}
// Get the token from the database
$token = (new plate_scanners_o())->getPlateScannerByApiKey($token);
// Check if the token exists