diff --git a/includes/modules/payment/novalnet/novalnet_extension.php b/includes/modules/payment/novalnet/novalnet_extension.php deleted file mode 100644 index 0c0d79b..0000000 --- a/includes/modules/payment/novalnet/novalnet_extension.php +++ /dev/null @@ -1,195 +0,0 @@ -'; - -// Prepare output based on suitable content components -if (defined('MODULE_PAYMENT_NOVALNET_STATUS') && MODULE_PAYMENT_NOVALNET_STATUS == 'True') { - $request = $_REQUEST; - $output = ''; - $output .= ''; - // Zero amount booking process - $order_total = $db->Execute("SELECT value FROM " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' AND orders_id = " . zen_db_input($request['oID'])); - if ($transaction_details->fields['amount'] == 0 && - isset($payment_details['zero_amount_booking']) && - $transaction_details->fields['status'] == 'CONFIRMED' - ) { - $amount = round($order_total->fields['value'], 2) * 100; - $output .= ''; - $output .= $nn_html; - $output .= '
'."\n"; - $output .= zen_draw_form('novalnet_book_amount', 'novalnet_extension_helper.php'); - $output .= $nn_html. ''; - $output .= ''; - $output .= ''; - $output .= zen_draw_hidden_field('oID', $request['oID']); - $output .= zen_draw_hidden_field('nn_zero_amount_book_confirm', MODULE_PAYMENT_NOVALNET_PAYMENT_ZERO_AMOUNT_BOOK_CONFIRM); - $output .= zen_draw_hidden_field('nn_amount_error', MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE); - $output .= ''; - $output .= ''; - $output .= ''; - $output .='
'; - $output .= '
'.MODULE_PAYMENT_NOVALNET_BOOK_AMT_TITLE . ''; - $output .= zen_draw_input_field('book_amount', $amount, 'id="book_amount" autocomplete="off" style="margin:0% 0% 0% 2%"') . MODULE_PAYMENT_NOVALNET_AMOUNT_EX . '
'.zen_draw_input_field('nn_book_confirm', html_entity_decode(MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT), 'class="btn btn-primary" onclick="return refund_amount_validation();" style="float:left"', false, 'submit').'
'."\n"; - } - - // Instalment refund and cancel process - if (!empty($transaction_details->fields['instalment_cycle_details'])) { - $instalment_details = json_decode($transaction_details->fields['instalment_cycle_details'], true); - if (!empty($instalment_details)) { - $output .= ' - '; - $output .= ''; - $output .= $nn_html; - $output .= '
'."\n"; - $output .= ''; - $output .= ' - - - - - - - - - '; - $nn_instalment_table = ''; - $instalment_amount = 0; - $status = []; - $sno = 1; - - // Custom sorting function - function sortByNextInstalmentDate($a, $b) { - // If next_instalment_date is empty or '-', set it to PHP_INT_MAX - $instalmentdateA = empty($a['next_instalment_date']) || $a['next_instalment_date'] == '-' ? PHP_INT_MAX : strtotime($a['next_instalment_date']); - $instalmentdateB = empty($b['next_instalment_date']) || $b['next_instalment_date'] == '-' ? PHP_INT_MAX : strtotime($b['next_instalment_date']); - return $instalmentdateA - $instalmentdateB; - } - - // Sorting the array using usort - usort($instalment_details, 'sortByNextInstalmentDate'); - - foreach ($instalment_details as $key => $instalment_details_data) { - $instalment_amount = (strpos((string) $instalment_details_data['instalment_cycle_amount'], '.')) ? $instalment_details_data['instalment_cycle_amount'] * 100 : $instalment_details_data['instalment_cycle_amount']; - - if (!empty($instalment_details_data['status'])) { - $status = $instalment_details_data['status']; - } else { - $status = (empty($instalment_details_data['reference_tid'])) ? 'Pending' : (($instalment_amount > 0) ? 'Paid' : 'Refunded'); - } - - $status = constant('MODULE_PAYMENT_NOVALNET_INSTALMENT_STATUS_' . strtoupper($status)); - $href = (isset($instalment_details_data['reference_tid']) && !empty($instalment_details_data['reference_tid']) != '' && $instalment_amount != '0' && $instalment_amount > 0 && $status != constant('MODULE_PAYMENT_NOVALNET_INSTALMENT_STATUS_REFUNDED')) ? " " : ''; - $instalment_amount_formatted = !empty($instalment_amount) ? $currencies->format($instalment_amount/100, 1, $order->info['currency']) : '-'; - - - $instalment_original_amount= isset($instalment_details_data['instalment_cycle_amount_orginal_amount']) ? $currencies->format($instalment_details_data['instalment_cycle_amount_orginal_amount']/100, 1, $order->info['currency']) : ''; - - $nn_instalment_table .= " - - - - "; - $nn_instalment_table .= ''; - } - - $nn_instalment_table .='
'; - $instalment_status = []; - - foreach ($instalment_details as $key => $instalment_details_data) { - array_push($instalment_status, $instalment_details_data['status']); - } - - $nn_instalment_canceled = false; - $nn_instacancel_remaining = 'style="display:block"'; - $nn_instacancel_allcycles = 'style="display:block"'; - - if (in_array('Canceled', $instalment_status)) { - $nn_instalment_canceled = true; - } elseif (in_array('Refunded', $instalment_status)) { - $nn_instacancel_remaining = 'style="display:block"'; - $nn_instacancel_allcycles = 'style="display:none"'; - } elseif (in_array('Paid', $instalment_status) && !empty($instalment_details_data['reference_tid'])) { - $nn_instacancel_remaining = 'style="display:none"'; - $nn_instacancel_allcycles = 'style="display:block"'; - } - if (in_array('Refunded', $instalment_status) && !empty($instalment_details_data['reference_tid'])) { - $nn_instalment_canceled = true; - } - - if ($nn_instalment_canceled == false) { - $output .= ''; - } - - $foundConfirm = true; - if (in_array('Refunded', $instalment_status)) { - foreach ($instalment_status as $status) { - if ($status === 'Paid') { - $foundConfirm = true; - } - } - if($foundConfirm == true){ - $nn_instacancel_allcycles = 'style="display:block"'; - } - } - - if ($nn_instalment_canceled == true) { - foreach ($instalment_status as $status) { - if ($status === 'Paid') { - $foundConfirm = true; - } - } - if($foundConfirm == true){ - $output .= ''; - $nn_instacancel_remaining = 'style="display:none"'; - } - } - - $output .= zen_draw_form('nn_instalment_cancel', 'novalnet_extension_helper.php'); - $output .= '
S.No'.MODULE_PAYMENT_NOVALNET_INSTALMENT_REFERENCE_BACKEND.''.MODULE_PAYMENT_NOVALNET_INSTALMENT_AMOUNT_BACKEND.''.MODULE_PAYMENT_NOVALNET_INSTALMENT_NEXT_DATE_BACKEND.''.MODULE_PAYMENT_NOVALNET_INSTALMENT_STATUS_BACKEND.''.MODULE_PAYMENT_NOVALNET_INSTALMENT_REFUND_BACKEND.'
".$sno++."".(isset($instalment_details_data['reference_tid']) ? $instalment_details_data['reference_tid'] : '')."".$instalment_original_amount."".(isset($instalment_details_data['next_instalment_date']) && !empty(trim($instalment_details_data['next_instalment_date'])) && trim($instalment_details_data['next_instalment_date']) != "-" ? NovalnetHelper::format_date( $instalment_details_data['next_instalment_date']) : ''). - "$status".$href."'.zen_draw_form('nn_refund_confirm', 'novalnet_extension_helper.php'); - $nn_instalment_table .= '
'."\n"; - $output .= $nn_instalment_table; - } - } - - $output .= ''; -}