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:
43
order.php
43
order.php
@@ -42,6 +42,23 @@ $order = ioServer($api_url,'');
|
||||
//Decode Payload
|
||||
if (!empty($order)){$order = json_decode($order,true);}else{$order = null;}
|
||||
|
||||
//HANDLE STATUS CHANGE
|
||||
if ($update_allowed === 1){
|
||||
if (isset($_POST['payment_status'])) {
|
||||
//GET ALL POST DATA
|
||||
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
//API call
|
||||
$responses = ioServer('/v2/transactions', $data);
|
||||
if ($responses === 'NOK'){
|
||||
|
||||
} else {
|
||||
header('Location: index.php?page=order&id='.$_POST['id'].'&success_msg=2');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle success messages
|
||||
if (isset($_GET['success_msg'])) {
|
||||
if ($_GET['success_msg'] == 1) {
|
||||
@@ -112,11 +129,33 @@ $view .='
|
||||
<div class="order-detail">
|
||||
<h3>Payment Method</h3>
|
||||
<p>' . (${$payment_method} ?? $order['header']['payment_method'] ). '</p>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
//STATUS CHANGE FORM
|
||||
if ($update_allowed === 1){
|
||||
$view .='
|
||||
<div class="order-detail">
|
||||
<h3>Payment Status</h3>
|
||||
<form action="" method="post" style="margin: 0;">
|
||||
<p><select id="payment_status" name="payment_status" onchange="this.form.submit();" style="border: none; background: transparent; padding: 0; cursor: pointer;">
|
||||
<option value="0" '.($order['header']['payment_status']==0?' selected':'').'>'.$payment_status_0.'</option>
|
||||
<option value="1" '.($order['header']['payment_status']==1?' selected':'').'>'.$payment_status_1.'</option>
|
||||
<option value="101" '.($order['header']['payment_status']==101?' selected':'').'>'.$payment_status_101.'</option>
|
||||
<option value="102" '.($order['header']['payment_status']==102?' selected':'').'>'.$payment_status_102.'</option>
|
||||
<option value="103" '.($order['header']['payment_status']==103?' selected':'').'>'.$payment_status_103.'</option>
|
||||
<option value="999" '.($order['header']['payment_status']==999?' selected':'').'>'.$payment_status_999.'</option>
|
||||
</select></p>
|
||||
<input type="hidden" name="id" value="'.$order['header']['id'].'">
|
||||
</form>
|
||||
</div>';
|
||||
} else {
|
||||
$view .='
|
||||
<div class="order-detail">
|
||||
<h3>Payment Status</h3>
|
||||
<p>' . (${$payment_status} ?? $order['header']['payment_status'] ). '</p>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
$view .='
|
||||
<div class="order-detail">
|
||||
<h3>Date</h3>
|
||||
<p>'.getRelativeTime($order['header']['created']). '</p>
|
||||
|
||||
Reference in New Issue
Block a user