Add PayPal webhook handler and marketing styles

- Implemented PayPal webhook for handling payment notifications, including signature verification and transaction updates.
- Created invoice generation and license management for software upgrades upon successful payment.
- Added comprehensive logging for debugging purposes.
- Introduced new CSS styles for the marketing file management system, including layout, toolbar, breadcrumb navigation, search filters, and file management UI components.
This commit is contained in:
“VeLiTi”
2026-01-09 15:19:28 +01:00
parent 08263c7933
commit 2520fb2b75
38 changed files with 4166 additions and 1107 deletions

View File

@@ -1353,6 +1353,47 @@ function ioAPIv2($api_call, $data, $token){
return $resp;
}
//------------------------------------------
// API TO API version 2 File Upload
//------------------------------------------
function ioAPIv2_FileUpload($api_call, $fileData, $additionalData = [], $token = '') {
include dirname(__FILE__,2).'/settings/settings_redirector.php';
$url = $baseurl . $api_call;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
// Prepare headers (no Content-Type for multipart uploads)
if ($token != '') {
$headers = array("Authorization: Bearer $token");
} else {
$headers = array();
}
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Merge file data with additional data
$postData = array_merge($fileData, $additionalData);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
$resp = curl_exec($curl);
$http_status = curl_getinfo($curl) ?? '200';
curl_close($curl);
if ($http_status['http_code'] == '403' || $http_status['http_code'] == '400') {
$resp = json_encode('NOK');
}
if (debug){
$message = $date.';'.$api_call;
debuglog($message);
}
return $resp;
}
//------------------------------------------
// DEFINE WHERECLAUSE BASED ON ACCOUNTHIERARCHY ALL
//------------------------------------------
@@ -1491,7 +1532,12 @@ function getProfile($profile, $permission){
'com_log' => 'U',
'software_update' => 'R',
'software_download' => 'R',
'software_available' => 'R'
'software_available' => 'R',
'marketing_files' => 'CRUD',
'marketing_folders' => 'CRUD',
'marketing_tags' => 'CRUD',
'marketing_upload' => 'CRUD',
'marketing_delete' => 'CRUD'
];
// Group permissions: [granting_page => [collection => allowed_actions_string]]