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:
@@ -32,10 +32,10 @@ $view_contracts = isAllowed('contracts' ,$_SESSION['profile'],$_SESSION['permis
|
||||
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||
|
||||
//CALL TO API FOR General information
|
||||
$api_url = '/v1/equipments/'.$GET_VALUES;
|
||||
$api_url = '/v2/equipments/'.$GET_VALUES;
|
||||
$responses = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||
if (!empty($responses)){$responses = json_decode($responses);}else{$responses = null;}
|
||||
$responses = $responses[0];
|
||||
|
||||
//CALL TO API FOR RELATED
|
||||
@@ -246,6 +246,46 @@ $view .= '<div class="content-block">
|
||||
<td style="width:25%;">'.$equipment_label6.'</td>
|
||||
<td>'.$responses->sw_version.'</td>
|
||||
</tr>';
|
||||
//Check if license is attached
|
||||
if (!empty($responses->sw_version_license)) {
|
||||
$view .= '<tr>
|
||||
<td style="width:25%;">'.($equipment_license ?? 'License').'</td>
|
||||
<td>'.$responses->sw_version_license;
|
||||
|
||||
// Check if license is active
|
||||
$current_date = date('Y-m-d H:i:s');
|
||||
$is_active = false;
|
||||
|
||||
if (!empty($responses->license_status) && $responses->license_status == 1) {
|
||||
$starts_at = $responses->starts_at ?? null;
|
||||
$expires_at = $responses->expires_at ?? null;
|
||||
|
||||
if ($starts_at && $expires_at) {
|
||||
if ($current_date >= $starts_at && $current_date <= $expires_at) {
|
||||
$is_active = true;
|
||||
}
|
||||
} elseif ($starts_at && !$expires_at) {
|
||||
if ($current_date >= $starts_at) {
|
||||
$is_active = true;
|
||||
}
|
||||
} elseif (!$starts_at && $expires_at) {
|
||||
if ($current_date <= $expires_at) {
|
||||
$is_active = true;
|
||||
}
|
||||
} elseif (!$starts_at && !$expires_at) {
|
||||
$is_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_active) {
|
||||
$view .= ' / '.$enabled ?? 'Active';
|
||||
} else {
|
||||
$view .= ' / '.$disabled ?? 'Inactive';
|
||||
}
|
||||
|
||||
$view .= '</td>
|
||||
</tr>';
|
||||
}
|
||||
//SHOW ONLY SW_UPGRADE WHEN SET
|
||||
if (isset($products_software) && $products_software !=''){
|
||||
foreach ($products_software as $products_soft){
|
||||
|
||||
Reference in New Issue
Block a user