Update: 2026-05-07 03:50:16
This commit is contained in:
@@ -91,8 +91,13 @@ try {
|
||||
$invoice['jofotara'] = null;
|
||||
}
|
||||
|
||||
// 5. Build the secure file URL using the invoice ID (file.php fetches path from DB)
|
||||
$invoice['file_url'] = '/index.php?route=v1/invoices/file&id=' . urlencode($id);
|
||||
// 5. Build the secure file URL with token (for Image.network compatibility)
|
||||
$authHeader = getallheaders()['Authorization'] ?? getallheaders()['authorization'] ?? '';
|
||||
$token = '';
|
||||
if (preg_match('/Bearer\s(\S+)/', $authHeader, $matches)) {
|
||||
$token = $matches[1];
|
||||
}
|
||||
$invoice['file_url'] = '/index.php?route=v1/invoices/file&id=' . urlencode($id) . '&token=' . $token;
|
||||
|
||||
// 6. Include local QR code from invoices table if available
|
||||
// (This is used as a fallback in shell.php if jofotara object is missing)
|
||||
|
||||
Reference in New Issue
Block a user