Add Mollie API integration and webhook for software upgrade payments
- Introduced the `CaBundle.php` class for managing CA certificates. - Updated `installed.json` and `installed.php` to include the new `composer/ca-bundle` dependency. - Added `platform_check.php` to enforce PHP version requirements. - Created `initialize.php` for initializing the Mollie API client with the API key. - Implemented `webhook_mollie.php` to handle webhook callbacks for software upgrade payments, including transaction status updates and invoice generation. - Integrated DomPDF for generating invoices and sending them via email.
This commit is contained in:
@@ -15,10 +15,30 @@ if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||
}
|
||||
$bearertoken = createCommunicationToken($_SESSION['userkey']);
|
||||
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// PAYMENT RETURN DETECTION
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
$payment_return = isset($_GET['payment_id']) ? $_GET['payment_id'] : null;
|
||||
$payment_return_status = isset($_GET['payment_return']) ? $_GET['payment_return'] : null;
|
||||
|
||||
template_header('Softwaretool', 'softwaretool','view');
|
||||
|
||||
$view = '
|
||||
// Show payment return message if returning from payment
|
||||
if ($payment_return && $payment_return_status) {
|
||||
$view = '
|
||||
<div class="content-title">
|
||||
<div style="background: #d4edda; border: 1px solid #c3e6cb; color: #155724; padding: 15px; border-radius: 6px; margin-bottom: 20px;">
|
||||
<i class="fa-solid fa-check-circle"></i>
|
||||
<strong>Payment Successful!</strong>
|
||||
<p style="margin: 10px 0 0 0;">Your payment has been processed. Please reconnect your device to apply the software upgrade.</p>
|
||||
<p style="margin: 5px 0 0 0; font-size: 12px; color: #666;">Payment ID: '.htmlspecialchars($payment_return).'</p>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$view = '';
|
||||
}
|
||||
|
||||
$view .= '
|
||||
<div class="content-title">
|
||||
<div class="title">
|
||||
<i class="fa-solid fa-box-open"></i>
|
||||
|
||||
Reference in New Issue
Block a user