Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Novalnet-Technic committed Aug 2, 2024
0 parents commit 5101bc3
Show file tree
Hide file tree
Showing 211 changed files with 16,225 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# NOVALNET PAYMENT MODULE FOR GAMBIO
<a href="https://www.novalnet.de/">Novalnet</a> payment module for gambio simplifies your daily work by automating the entire payment process, from checkout till collection. This module is designed to help you increase your sales by offering various payment methods on a one-page checkout. The module which is perfectly adjusted to the gambio shop with top-quality range of services of the payment provider.

## Gambio Module Integration Requirements
<a href="https://www.novalnet.de/">Novalnet</a> merchant account is required for processing all international and local payments through this Gambio payment module. The module is available for Gambio versions: 4.2.0.0 to 4.9.4.1 in the following languages: <b>EN, DE</b>

Through the individuality and flexibility, you can choose which payment methods and services you need. Get now a seamless integration with the various types of payments and payment-related services integrated in the one unique platform.

## Important functions for gambio
* Easy configuration for all payment methods
* One platform for all relevant payment types and related services
* Complete automation of all payment processes
* More than 50 fraud prevention modules integrated to prevent risk in real-time
* Effortless configuration of risk management with fraud prevention
* Comprehensive affiliate system with automated split conversion of transaction on revenue sharing
* Multilevel claims management with integrated handover to collection and various export functions for the Accounting
* Automated e-mail notification function concerning payment status reports
* Automated bookkeeping report in XML, SOAP, CSV, MT940
* No PCI DSS certification required
* Secure SSL- encoded gateways
* Easy way of managing ‘on-hold’ transactions (cancel or capture) and refunds (partial, full)
* Credit/Debit Card iframe integration
* Credit/Debit Card with 3D Secure
* One-click shopping supported for Credit/Debit Cards, Direct Debit SEPA, Direct Debit SEPA with payment guarantee & Instalment by Direct Debit SEPA
* Custom CSS configuration for Credit/Debit Card iframe
* Easy way of confirmation and cancellation of on-hold transactions for Direct Debit SEPA, Direct Debit SEPA with payment guarantee, Instalment payment for Direct Debit SEPA, Credit/Debit Cards, Invoice, Invoice with payment guarantee, Instalment payment for Invoice, Prepayment, PayPal, Apple Pay & Google Pay
* Refund option for Credit/Debit Cards, Direct Debit SEPA, Direct Debit ACH, Direct Debit SEPA with payment guarantee, Instalment by Direct Debit SEPA, Invoice, Invoice with payment guarantee, Instalment by Invoice, Prepayment, Barzahlen/viacash, Sofort, iDEAL, eps, giropay,
PayPal, Przelewy24, PostFinance Card, PostFinance E-Finance, Bancontact, Apple Pay, Google Pay, Online bank transfer, Alipay, WeChat pay, Trustly, Blik, Payconiq & TWINT
* Responsive templates
* Find currently supported payment methods on https://www.novalnet.com/integration/gambio-gx2-payment-module/

## More information
Find more about gambio module on: https://www.novalnet.de/site_pdf/Installation_Guide-gambio_4.2.0.0-4.9.4.1_novalnet_12.3.0.pdf<br>
To test our demo shop, please visit: https://gambio.novalnet.de

## Documentation & Support
For more information about the Gambio Payment Integration by Novalnet, please get in touch with us: <a href="mailto:sales@novalnet.de"> sales@novalnet.de </a> or +49 89 9230683-20<br>

Novalnet AG<br>
Zahlungsinstitut (ZAG)<br>
Gutenbergstraße 7<br>
D-85748 Garching<br>
Deutschland<br>
E-mail: sales@novalnet.de<br>
Tel: +49 89 9230683-20<br>
Web: www.novalnet.de

## License
See our License Agreement at: https://www.novalnet.com/payment-plugins/free/license

## About Novalnet AG
Novalnet AG is a leading financial services institution offering online gateways for processing of online payments. Operating in the market as a full payment service provider, Novalnet AG was founded in Ismaning near Munich, and provides online merchants user-friendly payment modules for all major shop systems as well as for self-programmed websites. The product and service portfolio is very comprehensive and includes all commonly used payment methods of online payment. These include a variety of intelligent fraud prevention modules, free technical support, an automated accounts receivable management system, a comprehensive subscription and membership management, as well as a very useful affiliate program. The experienced and international team of specialists at Novalnet is committed to support online merchants with in-depth knowledge and to work together with them hand in hand to increase their revenue and the quality of their online payments.
283 changes: 283 additions & 0 deletions admin/novalnet_extension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
<?php
/**
* Novalnet payment module
*
* This script is used for displaying the block of extension process
*
* @author Novalnet AG
* @copyright Copyright (c) Novalnet
* @license https://www.novalnet.de/payment-plugins/kostenlos/lizenz
* @link https://www.novalnet.de
*
* Script : novalnet_extension.php
*
*/
require_once(DIR_FS_CATALOG . 'ext/novalnet/NovalnetHelper.class.php');
/**
* To append Novalnet extension features in order details page
*
* @param integer $order_id
*/
function appendNovalnetOrderProcess($order_id) {
$request = $_REQUEST;
$transaction_details = NovalnetHelper::getNovalnetTransDetails($order_id);
if(empty($transaction_details)){
return false;
}
$order_total = xtc_db_fetch_array(xtc_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' AND orders_id = " . xtc_db_input($order_id)));
if ($transaction_details['amount'] == 0 && in_array($transaction_details['payment_type'],array('CREDITCARD', 'DIRECT_DEBIT_SEPA', 'DIRECT_DEBIT_ACH')) && $transaction_details['status'] == 'CONFIRMED') { // Zero amount booking transaction process
?>
<!-- Display zero amount booking block -->
<div class="content article-table grid">
<div class="span12 remove-padding">
<div class ="frame-wrapper">
<div class="frame-head">
<label class="title" ><?php echo MODULE_PAYMENT_NOVALNET_BOOK_TITLE; ?></label>
</div>
<?php echo xtc_draw_form('novalnet_book_amount', 'novalnet_extension_helper.php'); ?>
<label style="margin:0% 0% 0% 1%"><?php echo MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $transaction_details['tid']; ?></label>
<?php echo xtc_draw_hidden_field('oID', $request['oID']);?>
<table style="width=31%">
<tr>
<td>
<?php
$amount = $order_total['value']*100;
echo MODULE_PAYMENT_NOVALNET_BOOK_AMT_TITLE;
echo xtc_draw_input_field('book_amount', $amount, 'id="book_amount" autocomplete="off" style="margin:0% 0% 0% 2%"'); echo MODULE_PAYMENT_NOVALNET_AMOUNT_EX;
?>
</td>
</tr><br><span id="nn_zero_amount_error" style="color:red"></span>
<tr>
<td>
<?php
echo xtc_draw_input_field('nn_book_confirm', html_entity_decode(MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT), 'onclick="return zero_amount_validation();" style="float:left"',false,'submit');
echo "<a class='button' style='float:left' href='" . xtc_href_link('orders.php') . "'>" . MODULE_PAYMENT_NOVALNET_BACK_TEXT . "</a>";
?>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<?php
}
if($transaction_details['status'] == 'ON_HOLD' || in_array($transaction_details['status'], NovalnetHelper::$statuses['ON_HOLD'])) { // Display authorization block
?>
<!-- Transaction management block -->
<div class="content article-table grid">
<div class="span12 remove-padding">
<div class ="frame-wrapper">
<div class="frame-head">
<label class="title"><?php echo MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_TITLE; ?></label>
</div>
<?php
echo xtc_draw_form('novalnet_status_change', 'novalnet_extension_helper.php', 'oID=' . $_GET['oID'] . '&action=edit');
?>
<br><label style='margin:0% 0% 0% 1%'> <?php echo MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $transaction_details['tid']; ?></label>
<?php
echo xtc_draw_hidden_field('oID', $request['oID']);
echo xtc_draw_hidden_field('nn_capture_update', MODULE_PAYMENT_NOVALNET_PAYMENT_CAPTURE_CONFIRM);
echo xtc_draw_hidden_field('nn_void_update', MODULE_PAYMENT_NOVALNET_PAYMENT_VOID_CONFIRM);
?>
<table style="width:33%">
<tr>
<td>
<?php
echo MODULE_PAYMENT_NOVALNET_SELECT_STATUS_TEXT;
?>
</td>
<td>
<?php
$options = array (
array('id'=>'', 'text' => MODULE_PAYMENT_NOVALNET_SELECT_STATUS_OPTION),
array('id'=>'CONFIRM', 'text' => MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT),
array('id'=>'CANCEL', 'text' => MODULE_PAYMENT_NOVALNET_CANCEL_TEXT),
);
echo xtc_draw_pull_down_menu('trans_status', $options, '', 'onclick="return remove_void_capture_error_message()"');
?>
</td><br><span id="nn_void_capture_error" style="color:red"></span>
</tr>
<tr>
<td>
<?php
echo xtc_draw_input_field('nn_manage_confirm', html_entity_decode(MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT), 'onclick="return void_capture_status();" style="float:left"', false, 'submit');
echo "<a class='button' style='float:left' href='" . xtc_href_link('orders.php') . "'>" . MODULE_PAYMENT_NOVALNET_BACK_TEXT . "</a>";
?>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<?php
}
if (($transaction_details['amount'] > 0)
&& (($transaction_details['status'] == 'CONFIRMED' || in_array($transaction_details['status'], NovalnetHelper::$statuses['CONFIRMED']))
|| ($transaction_details['status']=='PENDING' && in_array($transaction_details['payment_type'], array('INVOICE', 'PREPAYMENT', 'CASHPAYMENT'))))
&& !in_array($transaction_details['payment_type'], array('MULTIBANCO', 'INSTALMENT_INVOICE', 'INSTALMENT_DIRECT_DEBIT_SEPA', 'novalnet_instalment_invoice', 'novalnet_instalment_sepa'))
&& ($transaction_details['refund_amount'] < $transaction_details['amount'])) {
?>
<!-- Display refund block -->
<div class="content article-table grid">
<div class="span12 remove-padding">
<div class ="frame-wrapper">
<div class="frame-head">
<label class="title" ><?php echo MODULE_PAYMENT_NOVALNET_REFUND_TITLE; ?></label>
</div>
<?php echo xtc_draw_form('novalnet_trans_refund', 'novalnet_extension_helper.php', 'oID=' . $_GET['oID'] . '&action=refund'); ?>
<label style='margin:0% 0% 0% 1%'> <?php echo MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $transaction_details['tid']; ?></label>
<?php
echo xtc_draw_hidden_field('oID', $request['oID']);
echo xtc_draw_hidden_field('nn_refund_amount', MODULE_PAYMENT_NOVALNET_PAYMENT_REFUND_CONFIRM);
?>
<br><span id="nn_refund_error" style="color:red"></span>
<table>
<tr>
<td>
<?php echo MODULE_PAYMENT_NOVALNET_REFUND_AMT_TITLE;?>
<?php
$avail_refund = (!empty($transaction_details['callback_amount'])) ? (int)$transaction_details['callback_amount'] : (int)$transaction_details['amount'];
$refund_value = (!empty($transaction_details['refund_amount'])) ? ((int)$avail_refund - (int)$transaction_details['refund_amount']) : $avail_refund;
echo xtc_draw_input_field('refund_trans_amount', $refund_value, 'id="refund_trans_amount" style="width:100px;margin:0 0 0 2%" autocomplete="off"'); echo MODULE_PAYMENT_NOVALNET_AMOUNT_EX;?>
</td>
</tr>
<tr>
<td>
<?php echo MODULE_PAYMENT_NOVALNET_REFUND_REASON_TITLE;?>
<?php
echo xtc_draw_input_field('refund_reason', '', 'id="refund_reason" style="margin:0 0 0 2%;" autocomplete="off"');?>
</td>
</tr>
<tr>
<td>
<?php
echo xtc_draw_input_field('nn_refund_confirm', html_entity_decode(MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT), 'onclick="return refund_amount_validation();" style="float:left"', false, 'submit');
echo "<a class='button' style='float:left' href='" . xtc_href_link('orders.php') . "'>" . MODULE_PAYMENT_NOVALNET_BACK_TEXT . "</a>";
?>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<?php
}
if (in_array($transaction_details['payment_type'], array('INSTALMENT_INVOICE', 'INSTALMENT_DIRECT_DEBIT_SEPA', 'novalnet_instalment_invoice', 'novalnet_instalment_sepa'))
) {
$instalment_details = (!empty($transaction_details['instalment_cycle_details'])) ? json_decode($transaction_details['instalment_cycle_details'], true) : unserialize($transaction_details['payment_details']);
if(!empty($instalment_details)) {
?>
<div class="content article-table grid">
<div class="span12 remove-padding">
<script>
function novalnetRefundbuttonsHandler(cycle) {
var refund_id = document.getElementById("instalment_refund_"+cycle);
if (refund_id.style.display === "none") {
refund_id.style.display = "block";
} else {
refund_id.style.display = "none";
}
}
</script>
<div class ="frame-wrapper">
<div class="frame-head">
<label class="title" ><?php echo MODULE_PAYMENT_NOVALNET_INSTALMENT_SUMMARY_BACKEND; ?></label>
</div>
<?php
$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) { ?>
<br><button id="nn_instalment_cancel" style="display: block;"> <?php echo MODULE_PAYMENT_NOVALNET_INSTALMENT_CANCEL_ADMIN_TEXT; ?> </button>
<?php }

?>
<div>
<?php
echo xtc_draw_form('nn_instalment_cancel', 'novalnet_extension_helper.php');
?><div id= "novalnet_instalment_cancel" style="display: none;"> <?php
echo xtc_draw_hidden_field('nn_insta_allcycles', MODULE_PAYMENT_NOVALNET_ALLCYCLES_ERROR_MESSAGE);
echo xtc_draw_hidden_field('nn_insta_remainingcycles', MODULE_PAYMENT_NOVALNET_REMAINING_CYCLES_ERROR_MESSAGE);
echo xtc_draw_hidden_field('oID', $request['oID']);
echo xtc_draw_input_field('nn_instacancel_remaincycles', html_entity_decode(MODULE_PAYMENT_NOVALNET_INSTALMENT_CANCEL_REMAINING_CYCLES), 'type="hidden" id="nn_instacancel_remaincycles" '. $nn_instacancel_remaining, false, 'submit') . "&nbsp;";
echo xtc_draw_input_field('nn_instacancel_allcycles', html_entity_decode(MODULE_PAYMENT_NOVALNET_INSTALMENT_CANCEL_ALLCYCLES), 'type="hidden" id="nn_instacancel_allcycles" ' . $nn_instacancel_allcycles, false, 'submit');
?>
</form>
</div>
<?php
echo "<table><tr><td>S.No</td><td>" .MODULE_PAYMENT_NOVALNET_INSTALMENT_REFERENCE_BACKEND . "</td><td>" .MODULE_PAYMENT_NOVALNET_INSTALMENT_AMOUNT_BACKEND . "</td><td>" .MODULE_PAYMENT_NOVALNET_INSTALMENT_NEXT_DATE_BACKEND . "</td><td>" . MODULE_PAYMENT_NOVALNET_INSTALMENT_STATUS_BACKEND . "</td><td>".MODULE_PAYMENT_NOVALNET_INSTALMENT_REFUND_EXTENSION_BACKEND."</td></tr>";
$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')) ? "<button id='nn_refund1' onclick='novalnetRefundbuttonsHandler($key)'>" . MODULE_PAYMENT_NOVALNET_REFUND_TEXT . "</button>" : '';
echo "<tr><td>".$sno++."</td><td>".(isset($instalment_details_data['reference_tid']) ? $instalment_details_data['reference_tid'] : ''). "</td>
<td>" .(isset($instalment_details_data['instalment_cycle_amount_orginal_amount']) ? xtc_format_price_order($instalment_details_data['instalment_cycle_amount_orginal_amount']/100,1,$transaction_details['currency']) : '') ."</td><td>". (isset($instalment_details_data['next_instalment_date']) ? $instalment_details_data['next_instalment_date'] : '') . "</td><td>$status</td><td>". $href."</td><td>".
xtc_draw_form('nn_refund_confirm', 'novalnet_extension_helper.php');
echo '<div id= instalment_refund_' . $key . ' style="display: none;">' ;
echo xtc_draw_hidden_field('oID', $request['oID']);
echo xtc_draw_hidden_field('refund_tid', (isset($instalment_details_data['reference_tid']) ? $instalment_details_data['reference_tid'] : ''));
echo xtc_draw_hidden_field('instalment_cycle', '' . $key . '');
echo xtc_draw_input_field('refund_trans_amount', $instalment_amount, 'id="refund_trans_amount" style="width:100px;margin:0 0 0 2%" autocomplete="off"');
echo xtc_draw_input_field('nn_refund_confirm', html_entity_decode(MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT), 'onclick="return refund_amount_validation();" style="float:left"', false, 'submit');
echo "<a class='button' style='float:left' href='" . xtc_href_link('orders.php?oID='.$request['oID'].'&action=edit') . "'>" . MODULE_PAYMENT_NOVALNET_INSTALMENT_CANCEL_TEXT . "</a>"; ?>
</div></form></td></tr><?php
}
echo "</table>";
?>
</div>
</div>
</div>
<?php
}

}

echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'ext/novalnet/js/novalnet_extension.min.js" integrity="sha384-buUfePrCioI2TwSpay1U+7akLDOHn1l55Mudc7LSQodabmvYotDtM7whmMkdSNMJ"></script>';
echo '<link rel="stylesheet" type="text/css" href="' . DIR_WS_CATALOG . 'ext/novalnet/css/novalnet.min.css">';
echo xtc_draw_hidden_field('nn_refund_amount_confirm', MODULE_PAYMENT_NOVALNET_PAYMENT_REFUND_CONFIRM);
echo xtc_draw_hidden_field('nn_select_status', MODULE_PAYMENT_NOVALNET_SELECT_STATUS_TEXT);
echo xtc_draw_hidden_field('nn_zero_amount_book_confirm', MODULE_PAYMENT_NOVALNET_PAYMENT_ZERO_AMOUNT_BOOK_CONFIRM);
echo xtc_draw_hidden_field('nn_amount_error', MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE);
echo xtc_draw_hidden_field('nn_insta_cycles', MODULE_PAYMENT_NOVALNET_CYCLES_ERROR_MESSAGE);
}
?>
Loading

0 comments on commit 5101bc3

Please sign in to comment.