diff --git a/admin/html/assets/javascript/modules/novalnet/novalnet_extension.js b/admin/html/assets/javascript/modules/novalnet/novalnet_extension.js new file mode 100644 index 0000000..3cc3f5f --- /dev/null +++ b/admin/html/assets/javascript/modules/novalnet/novalnet_extension.js @@ -0,0 +1,219 @@ +/** + * Novalnet extension feature Script + * By Novalnet (https://www.novalnet.de) + * Copyright (c) Novalnet +*/ +/** + * To check wheather number or not + * + * @param event + * return boolean + */ +function is_numeric_check(event) { + var keycode = ('which' in event) ? event.which : event.keyCode; + var reg = /^(?:[0-9]+$)/; + return (reg.test(String.fromCharCode(keycode)) || keycode == 0 || keycode == 8 || (event.ctrlKey == true && keycode == 114)) ? true : false; +} + +/** + * To validate iban bic field in refund + * + * @param event + * @param allowSpace + * return boolean + */ +function ibanbic_validate_extension(event, allowSpace) { + var keycode = ('which' in event) ? event.which : event.keyCode; + var reg = /^(?:[A-Za-z0-9]+$)/; + if(allowSpace == true) + var reg = /^(?:[A-Za-z0-9&\s]+$)/; + if(event.target.id == 'novalnet_sepa_account_holder') + var reg = /^(?:[A-Za-z-&.\s]+$)/; + return (reg.test(String.fromCharCode(keycode)) || keycode == 0 || keycode == 8 || (event.ctrlKey == true && keycode == 114) || ( allowSpace == true && keycode == 32))? true : false; +} + +/** + * To validate void capture option + * + * @param event + * return boolean + */ +function void_capture_status() { + if (document.getElementById('trans_status').value == '') { + document.getElementById('nn_void_capture_error').innerHTML=document.getElementsByName("nn_select_status")[0].value; + return false; + } + display_status = document.getElementById("trans_status").value == 100 ? document.getElementsByName("nn_capture_update")[0].value : document.getElementsByName("nn_void_update")[0].value; + if (!confirm(display_status)) { + return false; + } + return true; +} + +/** + * To remove the validation message + * + */ + function remove_void_capture_error_message() { + document.getElementById('nn_void_capture_error').innerHTML=''; + } + +/** + * To validate the subscription form + * + * @param event + * return boolean + */ +function validate_subscription_form() { + if (document.getElementById('subscribe_termination_reason').value =='') { + document.getElementById('nn_subs_cancel_error').innerHTML=document.getElementsByName("nn_subs_cancel")[0].value; + return false; + } + if (!confirm(document.getElementsByName("nn_subscription_cancel")[0].value)) { + return false; + } + return true; +} + +/** + * To remove the validation message + * + */ + function remove_subs_error_message() { + document.getElementById('nn_subs_cancel_error').innerHTML=''; + } + +/** + * To performing refund option in shop backend + */ +function refund_process() { + if (document.getElementById('refund_payment_type_sepa') && document.getElementById('refund_payment_type_sepa').checked) { + if(document.getElementById('direct_debit_sepa_tabletr')) + document.getElementById('direct_debit_sepa_tabletr').style.display="block"; + } else { + if(document.getElementById('direct_debit_sepa_tabletr')) + document.getElementById('direct_debit_sepa_tabletr').style.display="none"; + } +} +refund_process(); + +/** + * To validate the refund amount field + */ +function refund_amount_validation() { + if (document.getElementById('refund_ref') != null) { + var refund_ref = document.getElementById('refund_ref').value; + refund_ref = refund_ref.trim(); + var re = /[\/\\#,+!^()$~%.":*?<>{}]/g; + if (re.test(refund_ref)) { + document.getElementById('nn_refund_error').innerHTML=document.getElementsByName("nn_valid_account")[0].value; + return false; + } + } + else { + var amount = document.getElementById('refund_trans_amount').value; + if (amount.trim() == '' || amount == 0 || isNaN(amount)) { + document.getElementById('nn_refund_error').innerHTML= document.getElementsByName("nn_amount_error")[0].value; + return false; + } + } + if (document.getElementById('refund_payment_type_sepa') && document.getElementById('refund_payment_type_sepa').checked) { + var accholder = document.getElementById('refund_payment_type_accountholder').value; + var iban = document.getElementById('refund_payment_type_iban').value; + var bic = document.getElementById('refund_payment_type_bic').value; + if (accholder.trim() == '' || iban.trim() == '' || bic.trim()== '') { + document.getElementById('nn_refund_error').innerHTML=document.getElementsByName("nn_valid_account")[0].value; + return false; + } + } + if (!confirm(document.getElementsByName("nn_refund_amount_confirm")[0].value)) { + return false; + } +} + +/** + * To validate the account holder field in refund + * + */ +function account_holder_validate_extension(event, allowSpace) { + var keycode = ('which' in event) ? event.which : event.keyCode; + if (allowSpace == true) { var reg = /[^0-9\[\]\/\\#,+@!^()§$~%'"=:;<>{}\_\|*?`]/g }; + return (reg.test(String.fromCharCode(keycode)) || keycode == 0 || keycode == 45 ||keycode == 46 || keycode == 8 || (event.ctrlKey == true && keycode == 114) || ( allowSpace == true && keycode == 32))? true : false; +} + +/** + * To validate the zero amount processing + * + * @param event + */ +function zero_amount_validationt() { + var bookamount = document.getElementById('book_amount').value; + if (bookamount.trim() == '' || bookamount == 0 || isNaN(bookamount) ) { + document.getElementById('nn_zero_amount_error').innerHTML=document.getElementsByName("nn_amount_error")[0].value; + return false; + } + if (!confirm(document.getElementsByName("nn_zero_amount_book_confirm")[0].value)) { + return false; + } +} + +/** + * To validate the amount update process + */ +function validate_amount_update() { + var changeamount = (document.getElementById('new_amount').value).trim(); + if(document.getElementsByName('invoice_payment')[0].value == 1) { + var invoice_payment_due_date = document.getElementsByName('invoice_payment_due_date')[0].value; + var date = document.getElementById('amount_change_year').value + '-' + document.getElementById('amount_change_month').value + '-' + document.getElementById('amount_change_day').value; + var today_date = new Date(); + var current_day_value = ('0' + today_date.getDate()).slice(-2); + var current_month_value = ('0' + (today_date.getMonth() + 1)).slice(-2); + var current_year_value = today_date.getFullYear(); + var current_date_value = current_year_value + '-' + current_month_value + '-' + current_day_value; + if(!is_valid_date(date)) { + document.getElementById('nn_amount_update_error').innerHTML=document.getElementsByName("nn_duedate_error")[0].value; + return false; + } + if((date < current_date_value) || (date < invoice_payment_due_date)) { + document.getElementById('nn_amount_update_error').innerHTML=document.getElementsByName("nn_duedate_feature_error")[0].value; + return false; + } + } + if (changeamount == '' || changeamount <= 0 || isNaN(changeamount)) { + document.getElementById('nn_amount_update_error').innerHTML=document.getElementsByName("nn_amount_error")[0].value; + return false; + } + + var display_text = (document.getElementsByName('invoice_payment')[0].value == 1) ? document.getElementsByName("nn_duedate_update")[0].value :document.getElementsByName("nn_order_amount_update")[0].value; + if (!confirm(display_text)) { + return false; + } +} + +function is_valid_date(dueDate) { + if(dueDate == '') + return false; + var rxDatePattern = /^(\d{4})(\/|-)(\d{1,2})(\/|-)(\d{1,2})$/; //Declare Regex + var dtArray = dueDate.match(rxDatePattern); // is format OK? + if (dtArray == null) + return false; + + //Checks for yyyy/mm/dd format. + dtYear = dtArray[1]; + dtMonth = dtArray[3]; + dtDay = dtArray[5]; + if (dtMonth < 1 || dtMonth > 12) + return false; + else if (dtDay < 1 || dtDay> 31) + return false; + else if ((dtMonth==4 || dtMonth==6 || dtMonth==9 || dtMonth==11) && dtDay ==31) + return false; + else if (dtMonth == 2) + { + var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0)); + if (dtDay> 29 || (dtDay ==29 && !isleap)) + return false; + } + return true; +} + diff --git a/admin/novalnet.php b/admin/novalnet.php new file mode 100644 index 0000000..a286b23 --- /dev/null +++ b/admin/novalnet.php @@ -0,0 +1,32 @@ + +
+ + + + diff --git a/admin/novalnet_extension.php b/admin/novalnet_extension.php new file mode 100644 index 0000000..0b68b8f --- /dev/null +++ b/admin/novalnet_extension.php @@ -0,0 +1,347 @@ + + + + +
+
+
+
+ +
+ + + + + + +
+ + + +
+ +
+ " . MODULE_PAYMENT_NOVALNET_BACK_TEXT . ""; + ?> +
+ +
+
+
+ + +
+
+
+
+ +
+ +
+ + + + +
+ + + + +
+ + + +
+ " . MODULE_PAYMENT_NOVALNET_BACK_TEXT . ""; + ?> +
+ +
+
+
+ + +
+
+
+
+ +
+ + +
+ + + + + + $order_date ) { // date comparasion ?> + + + + +
+ : +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +
+ " . MODULE_PAYMENT_NOVALNET_BACK_TEXT . ""; + ?> +
+ +
+
+
+ + +
+
+
+
+ +
+ + + + + + +
+ + + + +
+ + + + +
+ " . MODULE_PAYMENT_NOVALNET_BACK_TEXT . ""; + ?> +
+ +
+
+
+ + +
+
+
+
+ +
+ + + + + + + + + + + + +
+ + + + +
+ + + +
+ + + + + +
+ " . MODULE_PAYMENT_NOVALNET_BACK_TEXT . ""; + ?> +
+ +
+
+
+ '; + echo xtc_draw_hidden_field('nn_valid_account', MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR); + echo xtc_draw_hidden_field('nn_amount_error', MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE); + echo xtc_draw_hidden_field('nn_duedate_feature_error', MODULE_PAYMENT_NOVALNET_VALID_DUEDATE_MESSAGE); + echo xtc_draw_hidden_field('nn_duedate_error', MODULE_PAYMENT_INVOICE_DUE_DATE_INVAILD); + echo xtc_draw_hidden_field('nn_refund_amount_confirm', MODULE_PAYMENT_NOVALNET_PAYMENT_REFUND_CONFIRM); + echo xtc_draw_hidden_field('nn_zero_amount_book_confirm', MODULE_PAYMENT_NOVALNET_PAYMENT_ZERO_AMOUNT_BOOK_CONFIRM); + echo xtc_draw_hidden_field('nn_select_status', MODULE_PAYMENT_NOVALNET_SELECT_STATUS_TEXT); + echo xtc_draw_hidden_field('nn_subs_cancel', MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_TITLE); +?> diff --git a/admin/novalnet_extension_helper.php b/admin/novalnet_extension_helper.php new file mode 100644 index 0000000..d7a5f68 --- /dev/null +++ b/admin/novalnet_extension_helper.php @@ -0,0 +1,303 @@ + $datas['vendor'], + 'product' => $datas['product'], + 'key' => $datas['payment_id'], + 'tariff' => $datas['tariff_id'], + 'auth_code' => $datas['auth_code'], + 'refund_request'=> '1', + 'tid' => $datas['tid'], + 'refund_param' => $request['refund_trans_amount'] + ); + if (!empty($request['refund_ref'])) { // Assigning refund ref tid + $refund_params['refund_ref'] = $request['refund_ref']; + } + if (isset($request['refund_paymenttype']) && $request['refund_paymenttype'] == 'SEPA') { // Param assigning for sepa payment only + $refund_params['iban'] = $request['refund_payment_type_iban']; + $refund_params['bic'] = $request['refund_payment_type_bic']; + $refund_params['account_holder'] = $request['refund_payment_type_accountholder']; + } + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $refund_params); + parse_str($response, $data); + $order_status = ''; + $param['gateway_status'] = $data['tid_status']; + if ($data['status'] == 100) { // Payment success + $message .= PHP_EOL . sprintf(utf8_encode(MODULE_PAYMENT_NOVALNET_REFUND_PARENT_TID_MSG), $datas['tid'], xtc_format_price_order(($request['refund_trans_amount'] / 100), 1, $datas['currency'])); + $newtid = !empty($data['tid']) ? $data['tid'] : (!empty($data['paypal_refund_tid']) ? $data['paypal_refund_tid'] : ''); + if (!empty($newtid)) { // Get new tid for refund process + $message .= sprintf(utf8_encode(MODULE_PAYMENT_NOVALNET_REFUND_CHILD_TID_MSG), $newtid); + } + $message .= PHP_EOL; + $order_status = xtc_db_fetch_array(xtc_db_query("SELECT orders_status from " . TABLE_ORDERS . " where orders_id = " . xtc_db_input($request['oID']))); + $order_status_value = $order_status['orders_status']; + $param['refund_amount'] = ($datas['refund_amount']+$request['refund_trans_amount']); + // Transaction details update the shop Novalnet table + xtc_db_perform('novalnet_transaction_detail', $param, "update", "tid='" . $datas['tid'] . "'"); + // Update the void status + if ($param['gateway_status'] != 100) { // Process for onhold + $order_status_value = MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED; + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $order_status_value + ), 'update', 'orders_id="' . $request['oID'] . '"'); + } + // Update the order status in shop + updateOrderStatus($request['oID'], $order_status_value, utf8_decode($message), true,true); + } + $response = http_build_query($data); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&'.$response.'&oID=' . (int)$request['oID'])); + } else if (!empty($request['new_amount']) && isset($request['nn_amount_update_confirm'])) { // To process amount update field + $orderInfo_details = unserialize($datas['payment_details']); + $due_date = $orderInfo_details['due_date']; + if (!empty($request['amount_change_year']) && !empty($request['amount_change_month']) && !empty($request['amount_change_day'])) { + $due_date = $request['amount_change_year'].'-'.$request['amount_change_month'].'-'.$request['amount_change_day']; + } + $amount_change_request = array( + 'vendor' => $datas['vendor'], + 'product' => $datas['product'], + 'key' => $datas['payment_id'], + 'tariff' => $datas['tariff_id'], + 'auth_code' => $datas['auth_code'], + 'edit_status' => '1', + 'tid' => $datas['tid'], + 'status' => 100, + 'update_inv_amount' => '1', + 'amount' => $request['new_amount'] + ); + if ($datas['payment_id'] == 27 && !empty($due_date)) { // Due_date added for payment invoice ,prepayment only + $amount_change_request['due_date'] = date('Y-m-d', strtotime($due_date)); + } + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $amount_change_request); + parse_str($response, $data); + if ($data['status'] == 100) { // Amount update success in shop + $message = PHP_EOL . sprintf(utf8_encode(MODULE_PAYMENT_NOVALNET_TRANS_UPDATED_MESSAGE), xtc_format_price_order(($amount_change_request['amount'] / 100), 1, $datas['currency']), date(DATE_FORMAT, strtotime(date('Y-m-d'))), date('H:i:s')) . PHP_EOL; + $orderInfo = xtc_db_fetch_array(xtc_db_query("SELECT orders_status from " . TABLE_ORDERS . " where orders_id = " . xtc_db_input($request['oID']))); + $param = array(); + $param = array ( + 'gateway_status'=> $data['tid_status'], + 'amount' => $amount_change_request['amount']); + if ($datas['payment_id'] == 37) { // Allow only sepa payment + $callback_param['order_amount'] =$callback_param['callback_amount'] = $amount_change_request['amount']; + xtc_db_perform('novalnet_callback_history', $callback_param, "update", "original_tid='" . $datas['tid'] . "'"); + } + if ($datas['payment_id'] == 27) { // Allowed only payment id 27 + $test_mode_text .= (($datas['test_mode'] == 1) ? PHP_EOL . MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE . PHP_EOL : ''); + $transaction_comments = ''; + // To form Novalnet transaction comments + $orderInfo_comments = NovalnetHelper::transactionCommentsForm($datas,$datas['payment_type']); + $novalnetPaymentReference = NovalnetHelper::formInvoicePrepaymentPaymentReference($datas['payment_ref'], $datas['payment_type'], $datas); + list($transaction_Details, $bank_details) = NovalnetHelper::formInvoicePrepaymentComments(array( + 'invoice_account' => $orderInfo_details['account_holder'], + 'invoice_bankname' => $orderInfo_details['bank_name'], + 'invoice_bankplace' => $orderInfo_details['bank_city'], + 'amount' => sprintf("%.2f", ($amount_change_request['amount'] / 100)), + 'currency' => $orderInfo_details['currency'], + 'tid' => $orderInfo_details['tid'], + 'invoice_iban' => $orderInfo_details['bank_iban'], + 'invoice_bic' => $orderInfo_details['bank_bic'], + 'due_date' => $amount_change_request['due_date'] + ), $test_mode_text); + $transaction_comments .= $orderInfo_comments . $transaction_Details . $novalnetPaymentReference; + $param['payment_details'] = serialize($bank_details); // To get bank details + $call_amount['order_amount'] = $amount_change_request['amount']; + xtc_db_perform('novalnet_callback_history',$call_amount , "update", "original_tid='" . $datas['tid'] . "'"); + + $orderInfo['comments'] = $transaction_comments; + xtc_db_perform(TABLE_ORDERS, $orderInfo, 'update', 'orders_id="' . $request['oID'] . '"'); + } + // Transaction details update the shop Novalnet table + xtc_db_perform('novalnet_transaction_detail', $param, "update", "tid='" . $datas['tid'] . "'"); + // Update the order status in shop + updateOrderStatus($request['oID'], $orderInfo['orders_status'], utf8_decode($message) . $transaction_comments, true, true); + } + $response = http_build_query($data); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&'.$response.'&oID=' . (int)$request['oID'])); + } else if (isset($request['nn_manage_confirm']) && !empty($request['trans_status'])) { // To process on-hold transaction + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', array( + 'vendor' => $datas['vendor'], + 'product' => $datas['product'], + 'key' => $datas['payment_id'], + 'tariff' => $datas['tariff_id'], + 'auth_code' => $datas['auth_code'], + 'edit_status' => '1', + 'tid' => $datas['tid'], + 'status' => $request['trans_status'] //Status 100 or 103 + )); + parse_str($response, $data); + if ($data['status'] == 100 || ($data['status'] == 90 && $datas['payment_type'] == 'novalnet_paypal' )) { // Payment success + $param = array( + 'gateway_status' => $data['tid_status'], + ); + if($datas['payment_type'] == 'novalnet_paypal') { + if(MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK' && !empty($data['paypal_transaction_id'])) { + $param['payment_details'] = serialize(array( + 'paypal_transaction_tid' => $data['paypal_transaction_id'], + 'novalnet_transaction_tid' => $datas['tid'])); + } + $amout_update['callback_amount'] = $data['tid_status'] == 90 ? 0 : $datas['amount']; + xtc_db_perform('novalnet_callback_history', $amout_update, "update", "original_tid='" . $datas['tid'] . "'"); + } + $order_status = ($request['trans_status'] == 100) ? MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE : MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED; + // Transaction details update the shop novalnet table + xtc_db_perform('novalnet_transaction_detail', $param, "update", "tid='" . $datas['tid'] . "'"); + // Update the order status in shop + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $order_status + ), 'update', 'orders_id="' . $request['oID'] . '"'); + $message = ($request['trans_status'] == 100) ? updateOrderStatus($request['oID'], $order_status, PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_SUCCESSFUL_MESSAGE, date(DATE_FORMAT, strtotime(date('d.m.Y'))), date('H:i:s')) . PHP_EOL, true,true) : updateOrderStatus($request['oID'], $order_status, PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_TRANS_DEACTIVATED_MESSAGE, date(DATE_FORMAT, strtotime(date('d.m.Y'))), date('H:i:s')) . PHP_EOL, true,true); + } + $response = http_build_query($data); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&'.$response.'&oID=' . (int)$request['oID'])); + } else if (!empty($request['nn_book_confirm']) && !empty($request['book_amount'])) { // To process zero amount booking transaction + $urlparams = unserialize($datas['payment_details']); + $urlparams['amount'] = trim($request['book_amount']); + $urlparams['order_no'] = $request['oID']; + $urlparams['payment_ref'] = $datas['tid']; + if (!empty($urlparams['sepa_due_date'])) { // Assigning Due date param sepa Payment only + $sepa_duedate = ((trim(MODULE_PAYMENT_NOVALNET_SEPA_DUE_DATE) != '' && trim(MODULE_PAYMENT_NOVALNET_SEPA_DUE_DATE) >= 7) ? trim(MODULE_PAYMENT_NOVALNET_SEPA_DUE_DATE) : 7); + $urlparams['sepa_due_date'] = (date('Y-m-d', strtotime('+' . $sepa_duedate . ' days'))); + } + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparams); + parse_str($response, $data); + if ($data['status'] == 100 || ( $data['status'] == 90 && $datas['payment_type'] == 'novalnet_paypal' )) { // Zero amount booking process success + $orderInfo = xtc_db_fetch_array(xtc_db_query("SELECT orders_status from " . TABLE_ORDERS . " where orders_id = " . xtc_db_input($request['oID']))); + $test_mode_msg = (isset($data['test_mode']) && $data['test_mode'] == 1) ? PHP_EOL . MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE . PHP_EOL : ''; + $message = PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS . PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $data['tid'] . $test_mode_msg; + $message .= PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_TRANS_BOOKED_MESSAGE, xtc_format_price_order(($request['book_amount'] / 100), 1, $datas['currency']), $data['tid']) . PHP_EOL; + $param['tid'] = $data['tid']; + xtc_db_perform('novalnet_subscription_detail', $param, "update", "order_no='" . xtc_db_input($request['oID']) . "'"); + $callback_param['original_tid'] = $data['tid']; + $callback_param['callback_amount']= ( $data['status'] == 100 ) ? $urlparams['amount'] : 0 ; + $callback_param['order_amount'] = $urlparams['amount']; + xtc_db_perform('novalnet_callback_history', $callback_param, "update", "order_no='" . xtc_db_input($request['oID']) . "'"); + $param = array( + 'amount' => $urlparams['amount'], + 'gateway_status' => $data['tid_status'], + 'tid' => $data['tid'], + ); + updateOrderStatus($request['oID'], $orderInfo['orders_status'], $message, true,true); + // Transaction details update the shop Novalnet table + xtc_db_perform('novalnet_transaction_detail', $param, "update", "order_no='" . xtc_db_input($request['oID']) . "'"); + } + $response = http_build_query($data); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&'.$response.'&oID=' . (int)$request['oID'])); + } else if (isset($request['nn_subs_confirm']) && !empty($request['subscribe_termination_reason'])) { // To process subscription cancel + dosubscriptionCancel($request,$datas); + } + + /** + * Update order status in the shop + * + * @param integer $order_id + * @param string $orders_status_id + * @param string $message + * @param boolean $insert_status_history + * @param boolean $customer_notified + */ + function updateOrderStatus($order_id, $orders_status_id, $message, $insert_status_history, $customer_notified) { + if ($insert_status_history) { // Insert record into shop table + $customer_notified_status = (($customer_notified) ? 1 : 0); + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $orders_status_id, + 'comments' => $message + ), "update", "orders_id='$order_id'"); + xtc_db_query("INSERT INTO " . TABLE_ORDERS_STATUS_HISTORY . " SET orders_id = '$order_id',orders_status_id = '$orders_status_id', date_added = NOW(), customer_notified = '$customer_notified_status', comments = '$message'"); + } + } + + /** + * To process the subscription cancel + * + * @param array $request + * @param array $datas + */ + function dosubscriptionCancel($request, $datas) { + $cancelSubscription = dosubscriptionStop(array( + 'tid' => $datas['tid'], + 'payment_id' => $datas['payment_id'], + 'termination_reason' => $request['subscribe_termination_reason'], + 'vendor' => $datas['vendor'], + 'tariff_id' => $datas['tariff_id'], + 'auth_code' => $datas['auth_code'], + 'product' => $datas['product'], + 'order_id' => $request['oID'] + )); + $page = array('message' => $cancelSubscription); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'page=1&oID=' . (int)$request['oID']).'&action=edit&'.http_build_query($page)); + } + + /** + * Perform subscription cancellation + * + * @param array $request + * @return string + */ + function dosubscriptionStop($request) { + $parent_tid = xtc_db_fetch_array(xtc_db_query("SELECT tid FROM novalnet_subscription_detail WHERE order_no='". xtc_db_input($request['order_id']) ."' ")); + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', array( + 'vendor' => $request['vendor'], + 'product' => $request['product'], + 'key' => $request['payment_id'], + 'tariff' => $request['tariff_id'], + 'auth_code' => $request['auth_code'], + 'cancel_sub' => '1', + 'tid' => $parent_tid['tid'], + 'cancel_reason' => $request['termination_reason'] + )); + parse_str($response, $data); + $params['gateway_status'] = $data['tid_status']; + if ($data['status'] == 100) { // Success of subscription cancellation + // Update gateway status in Novalnet table + xtc_db_perform('novalnet_transaction_detail', $params, "update", "tid=" . $parent_tid['tid']); + $params = array( + 'termination_reason' => $request['termination_reason'], + 'termination_at' => date('Y-m-d H:i:s') + ); + // Update subscription termination details in Novalnet subscription table + xtc_db_perform('novalnet_subscription_detail', $params, "update", "tid=" . $parent_tid['tid']); + $message = PHP_EOL . MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_MESSAGE . $request['termination_reason'] . PHP_EOL; + $subscription_orders = xtc_db_query("SELECT order_no FROM novalnet_subscription_detail WHERE tid='". xtc_db_input($parent_tid['tid']) ."' "); + // Update the order status in shop + while ($row = xtc_db_fetch_array($subscription_orders)) { + updateOrderStatus($row['order_no'], MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL, $message, true, true); + } + return $message; + } else { // Failure of subscription cancellation + $response = http_build_query($data); + // Redirect to shop + xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&'.$response.'&oID=' . (int)$request['order_id'])); + } + } + diff --git a/callback/novalnet/callback.php b/callback/novalnet/callback.php new file mode 100644 index 0000000..c1fa50a --- /dev/null +++ b/callback/novalnet/callback.php @@ -0,0 +1,588 @@ += 'v3.1.1.0') { + include_once(DIR_FS_CATALOG . 'vendor/true/punycode/src/Punycode.php'); +} +include(DIR_FS_INC . 'xtc_format_price_order.inc.php'); +require_once(DIR_FS_INC . 'xtc_php_mail.inc.php'); +include_once(DIR_FS_CATALOG . 'includes/external/novalnet/NovalnetHelper.class.php'); +$callback_parameter = array_map('trim', $_REQUEST); // Assign callback parameters +new novalnet_vendor_script($callback_parameter); // Novalnet callback class object +class novalnet_vendor_script { + + // Payment types of Level 0 - Initial level payments + protected $payments = array('CREDITCARD', 'INVOICE_START', 'DIRECT_DEBIT_SEPA', 'GUARANTEED_INVOICE_START', 'PAYPAL', 'ONLINE_TRANSFER', 'IDEAL', 'EPS', 'GIROPAY', 'PRZELEWY24', 'GUARANTEED_DIRECT_DEBIT_SEPA'); + + // Payment types of Level 1 - Chargeback payments + protected $chargebacks_payments = array('PRZELEWY24_REFUND', 'RETURN_DEBIT_SEPA', 'CREDITCARD_BOOKBACK', 'PAYPAL_BOOKBACK', 'CREDITCARD_CHARGEBACK', 'REFUND_BY_BANK_TRANSFER_EU', 'REVERSAL'); + + // Payment types of Level 2 - Credit entry and collection payments + protected $collection_payments = array('ONLINE_TRANSFER_CREDIT', 'INVOICE_CREDIT', 'GUARANTEED_INVOICE_CREDIT', 'CREDIT_ENTRY_CREDITCARD', 'CREDIT_ENTRY_SEPA', 'DEBT_COLLECTION_SEPA', 'DEBT_COLLECTION_CREDITCARD'); + + // Payment type of subscription + protected $subscription_payment = array('SUBSCRIPTION_STOP'); + + // Payment types Group */ + protected $payment_groups = array( + 'novalnet_cc' => array('CREDITCARD', 'CREDITCARD_BOOKBACK', 'CREDITCARD_CHARGEBACK', 'CREDIT_ENTRY_CREDITCARD', 'SUBSCRIPTION_STOP', 'DEBT_COLLECTION_CREDITCARD'), + 'novalnet_sepa' => array('DIRECT_DEBIT_SEPA', 'REFUND_BY_BANK_TRANSFER_EU','RETURN_DEBIT_SEPA', 'SUBSCRIPTION_STOP', 'DEBT_COLLECTION_SEPA', 'CREDIT_ENTRY_SEPA', 'GUARANTEED_DIRECT_DEBIT_SEPA'), + 'novalnet_ideal' => array('IDEAL', 'REFUND_BY_BANK_TRANSFER_EU', 'REVERSAL','ONLINE_TRANSFER_CREDIT'), + 'novalnet_instantbank'=> array('ONLINE_TRANSFER', 'ONLINE_TRANSFER_CREDIT', 'REFUND_BY_BANK_TRANSFER_EU', 'REVERSAL'), + 'novalnet_paypal' => array('PAYPAL', 'SUBSCRIPTION_STOP', 'PAYPAL_BOOKBACK'), + 'novalnet_prepayment' => array('INVOICE_START', 'INVOICE_CREDIT', 'SUBSCRIPTION_STOP'), + 'novalnet_invoice' => array('INVOICE_START', 'INVOICE_CREDIT', 'SUBSCRIPTION_STOP', 'GUARANTEED_INVOICE_START', 'GUARANTEED_INVOICE_CREDIT'), + 'novalnet_eps' => array('EPS','REFUND_BY_BANK_TRANSFER_EU'), + 'novalnet_giropay' => array('GIROPAY','REFUND_BY_BANK_TRANSFER_EU'), + 'novalnet_przelewy24' => array('PRZELEWY24', 'PRZELEWY24_REFUND')); + protected $callback_params = array(); + protected $order_reference = array(); + protected $params_required = array(); + protected $affiliated_params = array(); + protected $process_testmode; + protected $process_debugmode; + + // Novalnet IP address is a fixed value. DO NOT CHANGE!!!!! + protected $ip_allowed = array('195.143.189.210', '195.143.189.214'); + + function __construct($capture_parameter) { + $this->process_testmode = (MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE == 'True'); + $this->process_debugmode = (MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE == 'True'); + $this->validate_ip_address(); // Validate IP address + $this->params_required = array('vendor_id', 'tid', 'payment_type', 'status', 'tid_status'); + $this->affiliated_params = array('vendor_id', 'vendor_authcode', 'product_id', 'aff_id', 'aff_accesskey', 'aff_authcode'); + if (isset($capture_parameter['subs_billing']) && $capture_parameter['subs_billing'] == 1) { // Add signup_tid parameter as mandatory for subscription + array_push($this->params_required, 'signup_tid'); + } else if (in_array($capture_parameter['payment_type'], array_merge($this->chargebacks_payments, array('INVOICE_CREDIT', 'GUARANTEED_INVOICE_CREDIT')))) { // Add tid_payment parameter as mandatory for collection/chargeback payments + array_push($this->params_required, 'tid_payment'); + } + $this->callback_params = $this->validate_capture_params($capture_parameter); + $this->formatted_amount = xtc_format_price_order(($this->callback_params['amount'] / 100), 1, $this->callback_params['currency']); + $this->order_reference = $this->get_order_reference(); // Get the order reference of given callback request + $this->transaction_details = NovalnetHelper::getNovalnetTransDetails($this->order_reference['order_no']); + $payment_type_level = $this->get_payment_type_level(); + // level 0 payments - Initial payments + if ($payment_type_level === 0) { + $this->zero_level_process(); + } else if ($payment_type_level === 1 && $this->callback_params['status'] == 100 && $this->callback_params['tid_status'] == 100) { // level 1 payments - Type of charge backs + $this->first_level_process(); + } else if ($payment_type_level === 2 && $this->callback_params['status'] == 100 && $this->callback_params['tid_status'] == 100) { // level 2 payments - Type of credit entry + $this->second_level_process(); + } else if ((($this->callback_params['payment_type'] == 'SUBSCRIPTION_STOP')) || (!empty($this->callback_params['subs_billing']) && $this->callback_params['status'] != 100 && $this->callback_params['payment_type'] != 'SUBSCRIPTION_STOP')) { // Cancel the subscription process + $this->cancel_subscription(); + } else { // To validate the status and tid status + $status = ($this->callback_params['status'] != 100) ? 'status' : 'tid_status'; + $status_value = $this->callback_params['status'] != 100 ? $this->callback_params['status'] : $this->callback_params['tid_status']; + $this->display_message('Novalnet callback received. ' . $status . ' (' . $status_value . ') is not valid: Only 100 is allowed'); + } + } + + /* + * Validate IP address + * + */ + function validate_ip_address() { + $client_ip = NovalnetHelper::getIpAddress(xtc_get_ip_address()); + if (!in_array($client_ip, $this->ip_allowed) && !$this->process_testmode) { // Check IP address + $this->display_message("Novalnet callback received. Unauthorised access from the IP " . $client_ip, true); + } + } + + /** + * Validate the parameters + * + * @param array $capture_parameter + * @return array + */ + function validate_capture_params($capture_parameter) { + if (empty($capture_parameter)) { // Check whether the callback parameters are empty or not + $this->display_message('Novalnet callback received. No params passed over!'); + } + foreach (!empty($capture_parameter['vendor_activation']) ? $this->affiliated_params : $this->params_required as $values) { + if (empty($capture_parameter[$values])) { // Check required parameters + $this->display_message('Required param (' . $values . ') missing!'); + } else if (empty($capture_parameter['vendor_activation']) && in_array($values, array('tid', 'tid_payment', 'signup_tid')) && !preg_match('/^\d{17}$/', $capture_parameter[$values])) { // Validate TID + $this->display_message('Novalnet callback received. Invalid TID [' . $values . '] for Order.'); + } + } + if (!empty($capture_parameter['vendor_activation'])) { + $this->update_aff_account_activation($capture_parameter); + } else { + if (!in_array($capture_parameter['payment_type'], array_merge($this->payments, $this->chargebacks_payments, $this->collection_payments, $this->subscription_payment))) { // Validate payment type + $this->display_message('Novalnet callback received. Payment type (' . $capture_parameter['payment_type'] . ') is mismatched!'); + } else if ($capture_parameter['payment_type'] != 'SUBSCRIPTION_STOP' && (!is_numeric($capture_parameter['amount']) || $capture_parameter['amount'] < 0)) { // Validate amount + $this->display_message('Novalnet callback received. The requested amount (' . $capture_parameter['amount'] . ') is not valid'); + } + // Assign original transaction id + $capture_parameter['shop_tid'] = (!empty($capture_parameter['signup_tid'])) ? $capture_parameter['signup_tid'] : (in_array($capture_parameter['payment_type'], array_merge($this->chargebacks_payments, array('INVOICE_CREDIT','GUARANTEED_INVOICE_CREDIT'))) ? $capture_parameter['tid_payment'] : (!empty($capture_parameter['tid']) ? $capture_parameter['tid'] : '')); + } + return $capture_parameter; + } + + /* + * Get given payment_type level for process + * + * @return integer + */ + function get_payment_type_level() { + return in_array($this->callback_params['payment_type'], $this->payments) ? 0 : (in_array($this->callback_params['payment_type'], $this->chargebacks_payments) ? 1 : (in_array($this->callback_params['payment_type'], $this->collection_payments) ? 2 : false)); + } + + /** + * Payment types of Level 0 - Initial level payments processing + */ + function zero_level_process() { + // To create recurring order subscription transaction + if ($this->callback_params['subs_billing'] == 1 && $this->callback_params['status'] == 100 && in_array($this->callback_params['tid_status'], array( 85, 91,90, 98, 99, 100))) { + $recurring_callback_comments = sprintf(MODULE_PAYMENT_NOVALNET_CALLBACK_RECURRING_COMMENTS, $this->callback_params['shop_tid'], $this->formatted_amount, date('Y-m-d', strtotime(date('Y-m-d')) . ' days'), date('H:i:s'), $this->callback_params['tid']); + $charging_date = !empty($this->callback_params['next_subs_cycle']) ? $this->callback_params['next_subs_cycle'] : (!empty($this->callback_params['paid_until']) ? $this->callback_params['paid_until'] : ''); + $callback_comments = sprintf(MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGING_DATE_COMMENTS, $charging_date). PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_CALLBACK_REFERENCE_TID_COMMENTS, $this->callback_params['shop_tid']). PHP_EOL; + $this->create_new_order($this->order_reference['order_no'], $callback_comments, (array) $this->transaction_details); + $this->send_notify_mail(array( + 'comments' => $recurring_callback_comments . '
' . $callback_comments, + )); + } else if ($this->callback_params['subs_billing'] == 1 && $this->callback_params['status'] != 100) { // Subscription cancel when recurring order status other than 100 + $this->cancel_subscription(); + } else if (in_array($this->callback_params['payment_type'], array('PAYPAL', 'PRZELEWY24')) && $this->callback_params['tid_status'] == 100 && $this->callback_params['status'] == 100) { // To process paypal and przelewy24 payment pending status + if ($this->order_reference['order_paid_amount'] == 0) { // when paypal and przelewy24 payment in pending status only + //Update callback order status due to full payment + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => constant('MODULE_PAYMENT_NOVALNET_'.($this->callback_params['payment_type']).'_ORDER_STATUS') + ), 'update', 'orders_id="' . $this->order_reference['order_no'] . '"'); + $callback_comments = PHP_EOL . sprintf(html_entity_decode(MODULE_PAYMENT_NOVALNET_CALLBACK_UPDATE_COMMENTS), $this->callback_params['tid'], $this->formatted_amount, date("Y-m-d", strtotime(date('Y-m-d')) . ' days'), date('H:i:s')) . PHP_EOL; + // Update callback comments in order status history table + $this->update_callback_comments(array( + 'order_no' => $this->order_reference['order_no'], + 'comments' => $callback_comments, + 'orders_status_id' => constant('MODULE_PAYMENT_NOVALNET_'.($this->callback_params['payment_type']).'_ORDER_STATUS'), + 'callback_total_amount' => $this->order_reference['order_paid_amount'], + 'nnCaptureParams' => $this->callback_params, + 'order_total' => $this->order_reference['order_amount'] + )); + } + // Show callback message + $this->display_message('Novalnet Callbackscript received. Order already Paid'); + } else if ($this->callback_params['payment_type'] == 'PRZELEWY24' && ($this->callback_params['status'] != 100 || !in_array($this->callback_params['tid_status'], array(100,86)))) { // Cancel the przelewy24 payment when orignal transaction status other than 100 + //Update callback order status due to full payment + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED + ), 'update', 'orders_id="' . $this->order_reference['order_no'] . '"'); + // To form the server status message + $server_error = NovalnetHelper::getServerResponse($this->callback_params); + // To form the callback comments + $callback_comments = PHP_EOL . 'Novalnet Callbackscript received. ' . sprintf(MODULE_PAYMENT_NOVALNET_PRZELEWY_CANCEL_ORDER_MESSAGE, $server_error) . PHP_EOL; + // Update callback comments in order status history table + $this->update_callback_comments(array( + 'order_no' => $this->order_reference['order_no'], + 'comments' => $callback_comments, + 'orders_status_id' => MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED, + 'callback_total_amount' => $this->order_reference['order_paid_amount'], + 'nnCaptureParams' => $this->callback_params, + 'order_total' => $this->order_reference['order_amount'] + )); + } else { + // To display the message + $this->display_message('Novalnet Callbackscript received. Payment type (' . $this->callback_params['payment_type'] . ') is not applicable for this process!'); + } + } + + /** + * Payment types of Level 1 - Chargeback payments processing + */ + function first_level_process() { + // To get bookback comments or charge back comments + $callback_comments = in_array($this->callback_params['payment_type'], array('PAYPAL_BOOKBACK', 'REFUND_BY_BANK_TRANSFER_EU','CREDITCARD_BOOKBACK', 'PRZELEWY24_REFUND')) ? sprintf(PHP_EOL.MODULE_PAYMENT_NOVALNET_CALLBACK_BOOKBACK_COMMENTS, $this->callback_params['tid_payment'], $this->formatted_amount, date('Y-m-d'), date('H:i:s'), $this->callback_params['tid']) . PHP_EOL : PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGEBACK_COMMENTS, $this->callback_params['tid_payment'], $this->formatted_amount, date("Y-m-d", strtotime(date('Y-m-d')) . ' days'), date('H:i:s'), $this->callback_params['tid']) . PHP_EOL; + //Update the comments , order id and status id in Novalnet table + $this->update_callback_comments(array( + 'order_no' => $this->order_reference['order_no'], + 'comments' => $callback_comments, + 'orders_status_id' => $this->order_reference['order_current_status'], + 'nnCaptureParams' => $this->callback_params, + 'order_total' => $this->order_reference['order_amount'] + )); + } + + /** + * Payment types of Level 2 - Credit entry and collection payments processing + */ + function second_level_process() { + // To proceed the collection payment process + if (in_array($this->callback_params['payment_type'] , array('INVOICE_CREDIT','GUARANTEED_INVOICE_CREDIT'))) { + if ($this->order_reference['order_paid_amount'] < $this->order_reference['order_amount']) { + $callback_greater_amount = ''; + $callback_comments = PHP_EOL . sprintf(MODULE_PAYMENT_INVOICE_CREDIT_COMMENTS, $this->callback_params['shop_tid'], $this->formatted_amount, date("Y-m-d", strtotime(date('Y-m-d')) . ' days'), date('H:i:s'), $this->callback_params['tid']) . PHP_EOL; + $callback_status_id = $this->order_reference['order_current_status']; // partial payment paid after order status updated in shop + if ($this->order_reference['order_amount'] <= ($this->order_reference['order_paid_amount'] + $this->callback_params['amount'])) { + //Full payment paid after order status updated in shop + $callback_status_id = constant('MODULE_PAYMENT_'.strtoupper($this->order_reference['payment_type']).'_CALLBACK_ORDER_STATUS'); + $test_mode_text = ($this->callback_params['test_mode'] == 1) ? 'Test order' : ''; + list($test_order_msg, $tid_details) = array( + $test_mode_text, + MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS . PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_ID + ); + $nn_comments = PHP_EOL . $tid_details . $this->callback_params['shop_tid'] . PHP_EOL . $test_order_msg . PHP_EOL; + //Update callback order status and comments + xtc_db_perform(TABLE_ORDERS, array( + 'comments' => $nn_comments, + 'orders_status' => $callback_status_id, + ), 'update', 'orders_id="' . $this->order_reference['order_no'] . '"'); + $callback_greater_amount = (($this->order_reference['order_paid_amount'] + $this->callback_params['amount']) > $this->order_reference['order_amount']) ? 'Customer has paid more than the order amount' : ''; + } + // Update callback comments in order status history table + $this->update_callback_comments(array( + 'order_no' => $this->order_reference['order_no'], + 'comments' => $callback_comments, + 'greater_amount' => $callback_greater_amount, + 'orders_status_id' => $callback_status_id, + 'nnCaptureParams' => $this->callback_params, + 'callback_total_amount' => $this->order_reference['order_paid_amount'], + 'order_total' => $this->order_reference['order_amount'] + )); + } + // To display the message + $this->display_message('Novalnet callback received. Callback Script executed already. Refer Order:' . $this->order_reference['order_no']); + } + // To display the message + $this->display_message('Novalnet Callbackscript received. Payment type (' . $this->callback_params['payment_type'] . ') is not applicable for this process!'); + } + + /* + * Get order reference from the novalnet_callback_history table + * + * @return array + */ + function get_order_reference() { + $transaction_payment = xtc_db_fetch_array(xtc_db_query("SELECT payment_type FROM novalnet_transaction_detail WHERE tid = " . xtc_db_input($this->callback_params['shop_tid']))); // Get transaction details from Novalnet tables + $transaction_details = xtc_db_fetch_array(xtc_db_query("SELECT order_amount, order_no, sum(callback_amount) AS callback_total_amount FROM novalnet_callback_history WHERE original_tid = " . xtc_db_input($this->callback_params['shop_tid']))); // Get transaction details from Novalnet tables + if (!empty($transaction_details['order_no'])) { // Check db value + $transaction_details['tid'] = $this->callback_params['shop_tid']; + $transaction_details['payment_type'] = $transaction_payment['payment_type']; + list($transaction_details['order_current_status'], $transaction_details['nn_order_lang']) = $this->get_order_current_status($transaction_details['order_no']); + NovalnetHelper::loadLocaleContents($transaction_details['nn_order_lang']); + // To get paid amount information from shop + $transaction_details['order_paid_amount'] = 0; + // To proceed the payment type level 0 and 2 + if (in_array($this->get_payment_type_level(), array(0, 2))) { + // Get paid callback amount from db + $transaction_details['order_paid_amount'] = ((isset($transaction_details['callback_total_amount'])) ? $transaction_details['callback_total_amount'] : 0); + } + // To validate the payment type for original transaction + if (!isset($transaction_payment['payment_type']) || !in_array($this->callback_params['payment_type'], $this->payment_groups[$transaction_payment['payment_type']])) { + $this->display_message('Novalnet callback received. Payment Type [' . $this->callback_params['payment_type'] . '] is not valid.'); + } + // Check order no for the current transaction + if (!empty($this->callback_params['order_no']) && $this->callback_params['order_no'] != $transaction_details['order_no']) { + $this->display_message('Novalnet callback received. Order Number is not valid.'); + } + return $transaction_details; + } else { + // If order number is not available in Novalnet table, throw this message + $this->display_message('Transaction mapping failed'); + } + } + + /** + * Get orders details from the orders table + * + * @param integer $order_id + * @return array + */ + function get_order_current_status($order_id) { + // To get the order status from database + $order_details = xtc_db_fetch_array(xtc_db_query("select orders_status, language from " . TABLE_ORDERS . " where orders_id = " . xtc_db_input($order_id))); + return array( + $order_details['orders_status'], + $order_details['language'] + ); + } + + /* + * Update the transaction details in Novalnet table + * + * @param array $datas + * @return boolean + */ + function update_callback_comments($datas) { + // To update order details in shop + xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, array( + 'orders_id' => $datas['order_no'], + 'orders_status_id' => $datas['orders_status_id'], + 'date_added' => date("Y-m-d H:i:s"), + 'customer_notified'=> 1, + 'comments' => !empty($datas['comments']) ? $datas['comments'] : '' + )); + // To update order details in novalnet tables + if ($this->get_payment_type_level() != 1 || ($datas['payment_type'] == 'PRZELEWY24' && $datas['tid_status'] != 86)) { + $this->log_callback_process($datas); + } + // Send notification mail to Merchant + $this->send_notify_mail(array( + 'comments' => $datas['comments'], + 'greater_amount' => $datas['greater_amount'] + )); + } + + /** + * Display the error message + * + * @param string $errormessage + * @param boolean $ipBlock + */ + function display_message($errormessage, $ipBlock = false) { + if ($this->process_debugmode || $ipBlock) { // To Display message + echo utf8_decode($errormessage); + } + exit; + } + + /** + * Creation of order for recurring process + * + * @param integer $order_no + * @param string $callback_comments + * @param array $transaction_details + */ + function create_new_order($order_no, $callback_comments, $transaction_details) { + $order_details = xtc_db_fetch_array(xtc_db_query("SELECT*FROM " . TABLE_ORDERS . " WHERE orders_id = " . xtc_db_input($order_no))); + unset($order_details['orders_id']); + $order_details['date_purchased'] = $order_details['last_modified'] = date("Y-m-d H:i:s"); + xtc_db_perform(TABLE_ORDERS, $order_details, 'insert'); + $order_id = xtc_db_insert_id(); + $order_total_qry = xtc_db_query("SELECT title, text, value, class, sort_order FROM " . TABLE_ORDERS_TOTAL . " where orders_id = " . xtc_db_input($order_no)); + while ($order_total_array = xtc_db_fetch_array($order_total_qry)) { + $order_total_array['orders_id'] = $order_id; + xtc_db_perform(TABLE_ORDERS_TOTAL, $order_total_array); + } + $order_products_qry = xtc_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " where orders_id = " . xtc_db_input($order_no)); + while ($order_products_array = xtc_db_fetch_array($order_products_qry)) { + unset($order_products_array['orders_id']); + $order_products_id = $order_products_array['orders_products_id']; + unset($order_products_array['orders_products_id']); + $order_products_array['orders_id'] = $order_id; + xtc_db_perform(TABLE_ORDERS_PRODUCTS, $order_products_array); + $orders_products_id = xtc_db_insert_id(); + $products_qry = xtc_db_query("select products_quantity, products_ordered from " . TABLE_PRODUCTS . " where products_id = " . xtc_db_input($order_products_array['products_id'])); + $products_array = xtc_db_fetch_array($products_qry); + $products_quantity = $products_array['products_quantity'] - $order_products_array['products_quantity']; + $products_ordered = $products_array['products_ordered'] + $order_products_array['products_quantity']; + ($products_quantity < 1) ? xtc_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $products_quantity . "', products_ordered = '" . $products_ordered . "', products_status = '0' where products_id = '" . $order_products_array['products_id'] . "'") : xtc_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $products_quantity . "', products_ordered = '" . $products_ordered . "' where products_id = '" . $order_products_array['products_id'] . "'"); + $order_products_attr_qry = xtc_db_query("SELECT products_options, products_options_values, options_values_price, price_prefix FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = " . xtc_db_input($order_id) . " AND orders_products_id=" . xtc_db_input($order_products_id)); + while ($order_products_attr_array = xtc_db_fetch_array($order_products_attr_qry)) { + $order_products_attr_array['orders_id'] = $order_id; + $order_products_attr_array['orders_products_id'] = $order_products_id; + xtc_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $order_products_attr_array); + } + if (xtc_db_num_rows(xtc_db_query('SHOW TABLES LIKE "' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . '"'))) { + $order_products_downQry = xtc_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " WHERE orders_id = " . xtc_db_input($order_id) . " AND orders_products_id=" . xtc_db_input($order_products_id)); + while ($order_products_down_array = xtc_db_fetch_array($order_products_downQry)) { + $order_products_down_array['orders_id'] = $order_id; + $order_products_down_array['orders_products_id'] = $orders_products_id; + xtc_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $order_products_down_array); + } + } + } + $new_order_status = ($this->callback_params['payment_type'] == 'PAYPAL' && in_array($this->callback_params['tid_status'], array( 85,90 ))) ? MODULE_PAYMENT_NOVALNET_PAYPAL_PENDING_ORDER_STATUS : constant('MODULE_PAYMENT_' . strtoupper($transaction_details['payment_type']) . '_ORDER_STATUS'); + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $new_order_status + ), 'update', 'orders_id="' . $order_id . '"'); + $test_mode = !empty($this->callback_params['test_mode']) ? MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE . PHP_EOL : ''; + $novalnet_order_comments = MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS . PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . ' ' . $this->callback_params['tid'] . PHP_EOL . $test_mode; + list($order_comments, $bank_details) = (in_array($transaction_details['payment_type'], array('novalnet_invoice', 'novalnet_prepayment'))) ? $this->form_novalnet_comments() : array($novalnet_order_comments, ''); + // To create a new order + NovalnetHelper::logInitialTransaction(array_merge(array( + 'recurring_tid' => $this->callback_params['tid'], + 'callback_amount' => $this->callback_params['amount'], + 'recurring_amount' => $this->callback_params['amount'], + 'tid_status' => $this->callback_params['tid_status'], + 'new_order_no' => $order_id, + 'invoice_payment_details' => !empty($bank_details) ?serialize($bank_details) : '', + ), $transaction_details)); + // Update the transaction information in shop + if (!empty($order_comments)) { + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $new_order_status, + 'comments' => $order_comments . $callback_comments + ), 'update', 'orders_id="' . $order_no . '"'); + xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, array( + 'orders_id' => $order_id, + 'orders_status_id' => $new_order_status, + 'date_added' => date("Y-m-d H:i:s"), + 'customer_notified' => 1, + 'comments' => $order_comments . $callback_comments + )); + xtc_db_query('UPDATE ' . TABLE_ORDERS_TOTAL . ' SET value = "' . ($this->callback_params['amount']) . '", text = "' . xtc_format_price_order(($this->callback_params['amount'] / 100), 1, $this->callback_params['currency']) . '" WHERE orders_id = "' . $order_id . '" AND (class = "ot_total" OR class = "ot_subtotal")'); + } + xtc_db_perform('novalnet_subscription_detail', array( + 'order_no' => $order_id, + 'subs_id' => $transaction_details['subs_id'], + 'tid' => $transaction_details['tid'], + 'signup_date' => date('Y-m-d H:i:s'), + 'termination_reason' => '', + 'termination_at' => '' + )); + } + + /** + * To process cancel the subscription + * + */ + function cancel_subscription() { + // Get the subscription cancel message from server response + $subs_termination_reason = ($this->callback_params['payment_type'] == 'SUBSCRIPTION_STOP' && $this->callback_params['termination_reason'] != '') ? $this->callback_params['termination_reason'] : NovalnetHelper::getServerResponse($this->callback_params); + // Update the subscription reason in novalnet table + $this->update_subscription_reason(array( + 'termination_reason' => $subs_termination_reason, + 'termination_at' => date('Y-m-d H:i:s'), + 'tid' => $this->callback_params['shop_tid'] + )); + $callback_comments = PHP_EOL . sprintf(MODULE_PAYMENT_NOVALNET_CALLBACK_SUBS_STOP_COMMENTS, $this->callback_params['shop_tid'], date("Y-m-d", strtotime(date('Y-m-d')) . ' days'), date('H:i:s')); + $callback_comments .= PHP_EOL . MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_MESSAGE . $subs_termination_reason; + $db_query = xtc_db_query('SELECT order_no from novalnet_subscription_detail WHERE tid = "' . $this->callback_params['shop_tid'] . '"'); + while ($row = xtc_db_fetch_array($db_query)) { + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL, + ), 'update', 'orders_id="' . $row['order_no'] . '"'); + xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, array( + 'orders_id' => $row['order_no'], + 'orders_status_id' => MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL, + 'date_added' => date("Y-m-d H:i:s"), + 'customer_notified'=> 1, + 'comments' => $callback_comments + )); + } + // Send notification mail to Merchant + $this->send_notify_mail(array( + 'comments' => $callback_comments + )); + } + + /* + * Update affiliate account activation details in novalnet_aff_account_detail table + * + * @param $datas array + */ + function update_aff_account_activation($datas) { + // Update the affiliate account in Novalnet affiliate table + xtc_db_perform('novalnet_aff_account_detail', array( + 'vendor_id' => $datas['vendor_id'], + 'vendor_authcode' => $datas['vendor_authcode'], + 'product_id' => $datas['product_id'], + 'product_url' => $datas['product_url'], + 'aff_accesskey' => $datas['aff_accesskey'], + 'activation_date' => (($datas['activation_date'] != '') ? date('Y-m-d H:i:s', strtotime($datas['activation_date'])) : date('Y-m-d H:i:s')), + 'aff_id' => $datas['aff_id'], + 'aff_authcode' => $datas['aff_authcode'] + ), 'insert'); + // Send the notification mail to merchant + $this->send_notify_mail(array( + 'comments' => 'Novalnet callback script executed successfully with Novalnet account activation information.', + )); + } + + /** + * Log callback process in novalnet_callback_history table + * + * @param array $datas + */ + function log_callback_process($datas) { + // Update the transaction details in novalnet table + xtc_db_perform('novalnet_callback_history', array( + 'payment_type' => $datas['nnCaptureParams']['payment_type'], + 'original_tid' => $datas['nnCaptureParams']['shop_tid'], + 'callback_tid' => $datas['nnCaptureParams']['tid'], + 'order_amount' => $datas['order_total'], + 'callback_amount' => $datas['nnCaptureParams']['amount'], + 'order_no' => $datas['order_no'], + 'callback_datetime' => date('Y-m-d H:i:s') + ), 'insert'); + if (!empty($datas['nnCaptureParams']['amount'])) { + xtc_db_perform('novalnet_transaction_detail', array( + 'gateway_status' => $datas['nnCaptureParams']['tid_status'], + ), 'update', "order_no = '" . xtc_db_input($datas['order_no']) . "'"); + } + } + /** + * update subscription details in novalnet_subscription_detail table + * + * @param array $datas + */ + function update_subscription_reason($datas) { + // Update the transaction details in novalnet tables + xtc_db_perform('novalnet_subscription_detail', array( + 'termination_reason' => $datas['termination_reason'], + 'termination_at' => $datas['termination_at'] + ), 'update', "tid = '" . $datas['tid'] . "'"); + } + + /** + * Get the bank details for invoice & prepayment + * + * @return string + */ + function form_novalnet_comments() { + $novalnet_comments = PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS . PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $this->callback_params['tid'] . PHP_EOL; + $novalnet_comments .= !empty($this->callback_params['test_mode']) ? MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE . PHP_EOL : ''; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_INVOICE_COMMENTS_PARAGRAPH . PHP_EOL; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_DUE_DATE . date("m.d.Y", strtotime(!empty($this->callback_params['due_date']) ? $this->callback_params['due_date'] : '')) . PHP_EOL; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_ACCOUNT_HOLDER . ': NOVALNET AG' . PHP_EOL; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_IBAN.': '. (!empty($this->callback_params['invoice_iban']) ? $this->callback_params['invoice_iban'] : '') . PHP_EOL; + $novalnet_comments .= 'BIC: ' . (!empty($this->callback_params['invoice_bic']) ? $this->callback_params['invoice_bic'] : '') . PHP_EOL; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_BANK . (!empty($this->callback_params['invoice_bankname']) ? trim($this->callback_params['invoice_bankname']) : '') . ' ' . (!empty($this->callback_params['invoice_bankplace']) ? trim($this->callback_params['invoice_bankplace']) : '') . PHP_EOL; + $novalnet_comments .= MODULE_PAYMENT_NOVALNET_AMOUNT . xtc_format_price_order(($this->callback_params['amount'] / 100), 1, $this->callback_params['currency']) . PHP_EOL; + $bank_details = array( + 'tid' => $this->callback_params['tid'], + 'account_holder' => 'NOVALNET AG', + 'amount' => $this->callback_params['amount'] * 100, + 'currency' => $this->callback_params['currency'], + 'bank_iban' => $this->callback_params['invoice_iban'], + 'bank_bic' => $this->callback_params['invoice_bic'], + 'due_date' => $this->callback_params['due_date'], + 'bank_name' => utf8_decode($this->callback_params['invoice_bankname']), + 'bank_city' => utf8_decode($this->callback_params['invoice_bankplace']) + + ); + return array($novalnet_comments, $bank_details); + } + + + /** + * Send notification mail to Merchant + * + * @param array $datas + */ + function send_notify_mail($datas) { + + $datas['comments'] = str_replace(PHP_EOL, '
', $datas['comments']); + if (MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND == 'True') { // Check whether the notification mail option is enabled or not + // Assign email to address + $email_to = ((MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO != '') ? MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO : STORE_OWNER_EMAIL_ADDRESS); + // Assign bcc in email + $email_bcc = ((MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC != '') ? MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC : ''); + // Send mail + xtc_php_mail(EMAIL_FROM, STORE_NAME, $email_to, STORE_OWNER, $email_bcc, '', '', '', '', 'Novalnet Callback script notification', $datas['comments'], ''); + } + // Display callback message + $this->display_message(($datas['comments'] . $datas['greater_amount'])); + } +} + diff --git a/images/icons/novalnet/nn_loader.gif b/images/icons/novalnet/nn_loader.gif new file mode 100644 index 0000000..cf70c2e Binary files /dev/null and b/images/icons/novalnet/nn_loader.gif differ diff --git a/images/icons/novalnet/novalnet_cc_amex.png b/images/icons/novalnet/novalnet_cc_amex.png new file mode 100644 index 0000000..babf936 Binary files /dev/null and b/images/icons/novalnet/novalnet_cc_amex.png differ diff --git a/images/icons/novalnet/novalnet_cc_cartasi.png b/images/icons/novalnet/novalnet_cc_cartasi.png new file mode 100644 index 0000000..34b2500 Binary files /dev/null and b/images/icons/novalnet/novalnet_cc_cartasi.png differ diff --git a/images/icons/novalnet/novalnet_cc_maestro.png b/images/icons/novalnet/novalnet_cc_maestro.png new file mode 100644 index 0000000..61ba727 Binary files /dev/null and b/images/icons/novalnet/novalnet_cc_maestro.png differ diff --git a/images/icons/novalnet/novalnet_cc_visa.png b/images/icons/novalnet/novalnet_cc_visa.png new file mode 100644 index 0000000..f40da85 Binary files /dev/null and b/images/icons/novalnet/novalnet_cc_visa.png differ diff --git a/images/icons/novalnet/novalnet_eps.png b/images/icons/novalnet/novalnet_eps.png new file mode 100644 index 0000000..c2c930c Binary files /dev/null and b/images/icons/novalnet/novalnet_eps.png differ diff --git a/images/icons/novalnet/novalnet_giropay.png b/images/icons/novalnet/novalnet_giropay.png new file mode 100644 index 0000000..e3b55b0 Binary files /dev/null and b/images/icons/novalnet/novalnet_giropay.png differ diff --git a/images/icons/novalnet/novalnet_ideal.png b/images/icons/novalnet/novalnet_ideal.png new file mode 100644 index 0000000..962b33b Binary files /dev/null and b/images/icons/novalnet/novalnet_ideal.png differ diff --git a/images/icons/novalnet/novalnet_instantbank.png b/images/icons/novalnet/novalnet_instantbank.png new file mode 100644 index 0000000..74b04b8 Binary files /dev/null and b/images/icons/novalnet/novalnet_instantbank.png differ diff --git a/images/icons/novalnet/novalnet_invoice.png b/images/icons/novalnet/novalnet_invoice.png new file mode 100644 index 0000000..81d1284 Binary files /dev/null and b/images/icons/novalnet/novalnet_invoice.png differ diff --git a/images/icons/novalnet/novalnet_paypal.png b/images/icons/novalnet/novalnet_paypal.png new file mode 100644 index 0000000..f7764b5 Binary files /dev/null and b/images/icons/novalnet/novalnet_paypal.png differ diff --git a/images/icons/novalnet/novalnet_prepayment.png b/images/icons/novalnet/novalnet_prepayment.png new file mode 100644 index 0000000..d6fa402 Binary files /dev/null and b/images/icons/novalnet/novalnet_prepayment.png differ diff --git a/images/icons/novalnet/novalnet_przelewy24.png b/images/icons/novalnet/novalnet_przelewy24.png new file mode 100644 index 0000000..e31f1eb Binary files /dev/null and b/images/icons/novalnet/novalnet_przelewy24.png differ diff --git a/images/icons/novalnet/novalnet_sepa.png b/images/icons/novalnet/novalnet_sepa.png new file mode 100644 index 0000000..1ad4c35 Binary files /dev/null and b/images/icons/novalnet/novalnet_sepa.png differ diff --git a/includes/external/novalnet/NovalnetHelper.class.php b/includes/external/novalnet/NovalnetHelper.class.php new file mode 100644 index 0000000..1e9c1da --- /dev/null +++ b/includes/external/novalnet/NovalnetHelper.class.php @@ -0,0 +1,1046 @@ + 500000) { + return array(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_AMOUNT_ERROR,true,'guarantee_minimum'); + } + } + if(trim(constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_GUARANTEE_MAXIMUM_ORDER_AMOUNT')) != '') { + if(!ctype_digit(constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_GUARANTEE_MAXIMUM_ORDER_AMOUNT'))) { + return array(MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE,true,'amount_invaild'); + } else if((constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_GUARANTEE_MAXIMUM_ORDER_AMOUNT') > 500000 ) || (constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_GUARANTEE_MAXIMUM_ORDER_AMOUNT') <=constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_GUARANTEE_MINIMUM_ORDER_AMOUNT'))) { + return array(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_AMOUNT_ERROR,true,'guarantee_maximum'); + } + } + } else if (!function_exists('base64_encode') || !function_exists('base64_decode') || !function_exists('bin2hex') || !function_exists('pack') || !function_exists('crc32') || !function_exists('md5') || !function_exists('curl_init')) { + return array(MODULE_PAYMENT_NOVALNET_CONFIG_BLOCK_FUNC_ERROR,true,'function_exits'); + } + return false; + } + + /** + * Show error message in backend + * + * @param string $error_payment_name + * @param string $other_error + * @return string + */ + public static function displayErrorMessage($error_payment_name, $other_error) { + $_SESSION['flag'] = true; + return '
' . $error_payment_name . '

' . ($other_error != '' ? $other_error : MODULE_PAYMENT_NOVALNET_VALID_MERCHANT_CREDENTIALS_ERROR) . '
'; + } + + /** + * Validate E-mail address + * + * @param string $emails + * @return boolean + */ + static function validateEmail($emails) { + $email = explode(',', $emails); + foreach ($email as $value) { + if (!xtc_validate_email($value)) + return false; + } + return true; + } + + /** + * select the last successfull payment + * + * @param string $payment_name + */ + public static function getLastSuccessPayment($payment_name) { + if ($_SESSION['account_type'] != '' && empty($_SESSION['payment']) && MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION == 'True') { // Last successfull payment type + $sqlQuerySet = xtc_db_fetch_array(xtc_db_query("SELECT payment_type FROM novalnet_transaction_detail WHERE customer_id='". xtc_db_input($_SESSION['customer_id']) ."' ORDER BY id DESC LIMIT 1")); + if(!empty($sqlQuerySet['payment_type']) && $payment_name == $sqlQuerySet['payment_type'] ) { + $_SESSION['payment'] = $payment_name; + } + } + } + + + /** + * Validate status of fraud module + * + * @param string $payment_name + * @param string $fraud_module + * @return boolean + */ + public static function setFraudModuleStatus($payment_name, $fraud_module,$order_amount) { + global $order; + $customer_iso_code = strtoupper($order->billing['country']['iso_code_2']); + return (!$fraud_module || !in_array($customer_iso_code, array( 'DE', 'AT', 'CH' )) || (is_numeric(constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_CALLBACK_LIMIT')) && constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_CALLBACK_LIMIT') > $order_amount) || (!empty($_SESSION['novalnet'][$payment_name]['guarantee']))) ? false : true; + } + + + /** + * To get previous account details from database + * + * @param integer $customers_id + * @param string $payment_name + * @return array + */ + public static function getPaymentDetails($customers_id, $payment_name) { + return xtc_db_fetch_array(xtc_db_query("SELECT payment_details,process_key,payment_type FROM novalnet_transaction_detail WHERE customer_id='" . xtc_db_input($customers_id) . "' and payment_type = '" . xtc_db_input($payment_name) . "' AND reference_transaction = '0' AND payment_details != '' ORDER BY id DESC LIMIT 1")); + } + + /** + * Return payment amount of given order + * + * @return integer + */ + public static function getPaymentAmount() { + global $order; + return (sprintf('%0.2f', $order->info['total']) * 100); // Convert into cents + } + + /** + * To Visible payment in checkout for Minimum order amount + * + * @param string $payment_name + * @param integer $order_amount + * @return boolean + */ + public static function hidePaymentVisibility($payment_name, $order_amount) { + $visibility_amount = constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_VISIBILITY_BY_AMOUNT'); + return ($visibility_amount == '' || (int) $visibility_amount <= (int) $order_amount); + } + + /** + * Validate the DOB field in checkout page + * + * @param string $date + * return boolean + */ + public static function validateDuedate($date) { + $due_date = explode('-', $date); + //checkdate(month, day, year) + return (checkdate($due_date['1'], $due_date['2'], $due_date['0'])); + } + + /** + * Validate input form fraud module fields + * + * @param array $datas + * @param string $fraud_module + * @param string $payment_name + * @return string + */ + public static function validateCallbackFields($datas, $fraud_module, $payment_name) { + return ($fraud_module == 'CALLBACK' && (!is_numeric(trim($datas[$payment_name . '_fraud_tel'])))) ? MODULE_PAYMENT_NOVALNET_FRAUDMODULE_TELEPHONE_ERROR : ( ($fraud_module == 'SMS' && (!is_numeric($datas[$payment_name . '_fraud_mobile']) || strlen($datas[$payment_name . '_fraud_mobile']) < 8)) ? MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_ERROR : ''); + } + + /** + * Return address information of given order + * + * @param array $datas + * @return array + */ + public static function getCustomerAddressInfo($datas) { + $value = array(); + foreach (array( 'firstname', 'lastname', 'gender', 'street_address', 'city', 'postcode', 'telephone', 'country', 'company' ) as $values) + $value[$values] = ((isset($datas['billing'][$values]) && $datas['billing'][$values] != '') ? $datas['billing'][$values] : $datas['customer'][$values]); + + $value['country'] = ((isset($datas['billing']['country']['iso_code_2']) && $datas['billing']['country']['iso_code_2'] != '') ? $datas['billing']['country']['iso_code_2'] : $datas['customer']['country']['iso_code_2']); + return $value; + } + + /** + * Return countries list + * + * @return array + */ + static function sepaBankCountry() { + $countries = function_exists('xtc_get_countriesList') ? xtc_get_countriesList() : xtc_get_countries(); + $countrieslist = sizeof($countries); + $countries_array = array(); + $countries_array[] = array( + 'id' => '', + 'text' => MODULE_PAYMENT_NOVALNET_SELECT_STATUS_OPTION + ); + for ($i = 0, $n = $countrieslist; $i < $n; $i++) { + $country_id = xtc_get_countries_with_iso_codes($countries[$i]['countries_id']); + $countries_array[] = array( + 'id' => $country_id['countries_iso_code_2'], + 'text' => $countries[$i]['countries_name'] + ); + } + return $countries_array; + } + + /** + * To get Merchant credentials + * + * @return array + */ + public static function getVendorDetails() { + $tariff_details = explode('-', MODULE_PAYMENT_NOVALNET_TARIFF_ID); + return array( + 'vendor' => trim(MODULE_PAYMENT_NOVALNET_VENDOR_ID), + 'auth_code' => trim(MODULE_PAYMENT_NOVALNET_AUTHCODE), + 'product' => trim(MODULE_PAYMENT_NOVALNET_PRODUCT_ID), + 'tariff' => $tariff_details[1], + 'access_key' => trim(MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY), + 'tariff_type' => $tariff_details[0], + 'manual_limit'=> trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT) + ); + } + + /** + * Get the payment key + * + * @param string $payment_name + * @return integer + */ + public static function getPaymentKey($payment_name) { + $payment_key = array( + 'novalnet_cc' => '6', + 'novalnet_prepayment' => '27', + 'novalnet_invoice' => '27', + 'novalnet_instantbank' => '33', + 'novalnet_paypal' => '34', + 'novalnet_sepa' => '37', + 'novalnet_ideal' => '49', + 'novalnet_eps' => '50', + 'novalnet_giropay' => '69', + 'novalnet_przelewy24' => '78', + ); + return $payment_key[$payment_name]; + } + + /** + * Generate Novalnet gateway parameters based on payment selection + * + * @param array $datas + * @return array + */ + function getCommonParms($datas) { + include(DIR_FS_CATALOG . 'release_info.php'); // Get shop version + $payment_name = ((isset($datas['payment'])) ? $datas['payment'] : $datas['info']['payment_method']); + $language = ((isset($_SESSION['language_code'])) ? strtoupper($_SESSION['language_code']) : 'DE'); + $customer_info_address = self::getCustomerAddressInfo($datas); + $customer_info_details = self::getCustomerdetails($datas['customer']['email_address']); + $vendor_details = self::getVendorDetails($payment_name); + $client_ip = xtc_get_ip_address(); + $remote_ip = self::getIpAddress($client_ip); + $system_ip = self::getIpAddress($_SERVER['SERVER_ADDR']); + $urlparam = array_merge(array( + 'vendor' => $vendor_details['vendor'], + 'product' => $vendor_details['product'], + 'key' => self::getPaymentKey($payment_name), + 'tariff' => $vendor_details['tariff'], + 'auth_code' => $vendor_details['auth_code'], + 'currency' => $datas['info']['currency'], + 'first_name' => $customer_info_address['firstname'], + 'last_name' => $customer_info_address['lastname'], + 'gender' => $customer_info_address['gender'], + 'email' => $datas['customer']['email_address'], + 'street' => $customer_info_address['street_address'], + 'search_in_street' => 1, + 'city' => $customer_info_address['city'], + 'zip' => $customer_info_address['postcode'], + 'lang' => $language, + 'language' => $language, + 'country' => $customer_info_address['country'], + 'country_code' => $customer_info_address['country'], + 'tel' => $customer_info_address['telephone'], + 'test_mode' => constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_TEST_MODE') == 'True' ? 1 : 0, + 'customer_no' => ((!empty($_SESSION['customer_id'])) ? $_SESSION['customer_id'] : 'guest'), + 'amount' => $datas['payment_amount'], + 'system_name' => 'Gambio', + 'system_version' => $gx_version . '-NN-' . '11.1.0', + 'system_url' => ((ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG), + 'system_ip' => $system_ip, + 'remote_ip' => $remote_ip, + 'notify_url' => MODULE_PAYMENT_NOVALNET_CALLBACK_URL + ), array_filter(array( + 'fax' => $customer_info_details['customers_fax'], + 'birthdate' => $customer_info_details['customers_dob'], + 'company' => $customer_info_address['company'], + 'referrer_id' => trim(MODULE_PAYMENT_NOVALNET_REFERRER_ID), + 'tariff_period' => trim(MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD), + 'tariff_period2' => trim(MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2), + 'tariff_period2_amount' => trim(MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT), + 'inputval1' => trim(strip_tags(constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_TRANS_REFERENCE1'))), + 'input1' => (trim(strip_tags(constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_TRANS_REFERENCE1'))) != '') ? 'Reference1' : '', + 'inputval2' => trim(strip_tags(constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_TRANS_REFERENCE2'))), + 'input2' => (trim(strip_tags(constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_TRANS_REFERENCE2'))) != '') ? 'Reference2' : '' + ))); + self::getAffDetails($urlparam); // Appending affiliate parameters + return $urlparam; + } + + /** + * Validate the ipv6 for ipaddress + * + * @param array $ipaddress + * return integer + */ + public static function getIpAddress($ipaddress) { + return (filter_var($ipaddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || $ipaddress == '::1') ? '127.0.0.1' : $ipaddress; + } + + /** + * Collect Customer DOB, FAX, Gender information from the database + * + * @param string $customer_email + * @return array + */ + public static function getCustomerdetails($customer_email) { + if ($customer_email != '') { // Get enduser info from database + $querySearch = (isset($_SESSION['customer_id']) && $_SESSION['customers_status']['customers_status_id'] != '1') ? 'customers_id= "' . xtc_db_input($_SESSION['customer_id']) . '"' : 'customers_email_address= "' . xtc_db_input($customer_email) . '"'; + $customer_dbvalue = xtc_db_fetch_array(xtc_db_query("SELECT customers_id, customers_cid, customers_gender, customers_dob, customers_fax FROM " . TABLE_CUSTOMERS . " WHERE " . $querySearch . " ORDER BY customers_id DESC LIMIT 1")); + $customer_dbvalue['customers_dob'] = (!in_array($customer_dbvalue['customers_dob'], array( '0000-00-00 00:00:00', '1000-01-01 00:00:00'))) ? date('Y-m-d', strtotime($customer_dbvalue['customers_dob'])) : ''; + return $customer_dbvalue; + } + } + + /** + * Communicate transaction parameters with Novalnet paygate + * + * @param string $paygate_url + * @param array $datas + * @param boolean $build_query + * @return array + */ + public static function doPaymentCurlCall($paygate_url, $datas, $build_query = true) { + $paygate_query = ($build_query) ? http_build_query($datas) : $datas; + $curl = curl_init($paygate_url); + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_POSTFIELDS, $paygate_query); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_TIMEOUT, ((MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT != '' && MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT > 240) ? MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT : 240)); // Custom cURL time-out + if (trim(MODULE_PAYMENT_NOVALNET_PROXY) != '') { // Custom proxy option + curl_setopt($curl, CURLOPT_PROXY, trim(MODULE_PAYMENT_NOVALNET_PROXY)); + } + $response = curl_exec($curl); + $error_no = curl_errno($curl); + $error = curl_error($curl); + curl_close($curl); + if ($error_no > 0) { + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $_SESSION['payment'] . '&error=' . $error, 'SSL', true, false)); + } + return $response; + } + + /** + * Validate redirect payment server response + * + * @param string $payment_name + * @param array $payment_response + * @return array + */ + public static function validateRedirectResponse($payment_name, $payment_response) { + if ($payment_response['hash2'] != self::generatemd5Value($payment_response)) { + $payment_error_return = 'payment_error=' . $payment_name . '&error_message=' . html_entity_decode(MODULE_PAYMENT_NOVALNET_TRANSACTION_REDIRECT_ERROR); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + $payment_response = NovalnetHelper::decodePaygateResponse($payment_response); + $payment_response = NovalnetHelper::checkPaymentStatus($payment_name, $payment_response); + // Response value stored in session + return $payment_response; + } + + /** + * Form transaction comments and assign session value + * + * @param string $payment_name + * @param array $response + * @param array $payment_param + * @return array + */ + public static function checkPaymentStatus($payment_name, $response,$payment_param = '') { + global $order; + $order_comments = $transaction_status_failed = ''; + if ($response['status'] == 100 || ($payment_name == 'novalnet_paypal' && $response['status'] == 90)) { // Payment Success + $order_comments = self::transactionCommentsForm($response, $payment_name ); + if (in_array($payment_name, array( 'novalnet_invoice', 'novalnet_prepayment' ))) { + list($order_invoice_comments, $bank_details) = self::formInvoicePrepaymentComments($response); + $_SESSION['novalnet'][$payment_name]['serialize_data'] = serialize($bank_details); + } + $response['novalnet_comments'] = $_SESSION['novalnet'][$payment_name]['novalnet_comments'] = ((($order->info['comments'] != '') ? PHP_EOL . $order->info['comments'] : '')) . $order_comments.(!empty($order_invoice_comments) ? $order_invoice_comments : ''); + if ($payment_name == 'novalnet_sepa') { // Sepa hash value added for sepa payment process + $sepa_hash = !empty($_SESSION['novalnet'][$payment_name]['hash']) ? $_SESSION['novalnet'][$payment_name]['hash'] : ''; + } + $redirect_payments = array('novalnet_cc','novalnet_paypal','novalnet_ideal','novalnet_eps','novalnet_instantbank','novalnet_giropay','novalnet_przelewy24'); + $_SESSION['novalnet'][$payment_name] = array( + 'vendor_id' => in_array($payment_name,$redirect_payments) ? $response['vendor'] : $payment_param['vendor'], + 'product_id' => in_array($payment_name,$redirect_payments) ? $response['product'] : $payment_param['product'], + 'tariff_id' => in_array($payment_name,$redirect_payments) ? $response['tariff'] : $payment_param['tariff'], + 'authcode' => in_array($payment_name,$redirect_payments) ? $response['auth_code'] : $payment_param['auth_code'], + 'tid' => $response['tid'], + 'gateway_response' => $response, + 'payment_id' => !empty ($response['key']) ? $response['key'] : $payment_param['key'], + 'reference_transaction' => isset($_SESSION['novalnet'][$payment_name]['reference_transaction']) ? '1' : '0', + 'serialize_data' => !empty($_SESSION['novalnet'][$payment_name]['serialize_data']) ? $_SESSION['novalnet'][$payment_name]['serialize_data'] : '', + 'test_mode' => $response['test_mode'], + 'status' => $response['status'], + 'customer_id' => $response['customer_no'], + 'intial_order_amount' => $_SESSION['novalnet'][$payment_name]['nn_order_amount'], + 'process_key' => ($payment_name == 'novalnet_sepa') ? $sepa_hash : '', + 'next_payment_date' => in_array($payment_name, array( 'novalnet_paypal', 'novalnet_cc' )) ? $response['next_subs_cycle'] : $response['paid_until'] ); + return $response; + } else { // Payment failed + unset($_SESSION['novalnet'][$payment_name]['reference_transaction']); + $transaction_status_failed = NovalnetHelper::getServerResponse($response); + $payment_error_return = 'payment_error=' . $payment_name . '&error_message=' . $transaction_status_failed; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + + } + + /** + * Perform the decoding paygate response process for redirection payment methods + * + * @param array $datas + * @return string + */ + public static function decodePaygateResponse($datas) { + foreach (array( + 'auth_code', + 'product', + 'tariff', + 'amount', + 'test_mode', + 'uniqid' + ) as $value) { + $datas[$value] = self::generateDecode($datas[$value]); + } + return $datas; + } + + /** + * Validate pin field + * + * @param string $payment_module + * @param array $datas + * @param string $fraud_module + */ + public static function validateUserInputsOnCallback($payment_module, $datas, $fraud_module) { + $datas = array_map('trim', $datas); + if (in_array($fraud_module, array( 'CALLBACK', 'SMS' ))) { + if (!isset($datas[$payment_module . '_new_pin']) && isset($datas[$payment_module . '_fraud_pin']) && (!preg_match('/^[a-zA-Z0-9]+$/', $datas[$payment_module . '_fraud_pin']))) { + $fraud_module_error = $datas[$payment_module . '_fraud_pin'] == '' ? MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_EMPTY : MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_NOTVALID; + $payment_error_return = 'payment_error=' . $payment_module . '&error_message=' . $fraud_module_error; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + } + + /** + * Redirect to checkout on sucess using fraud module + * + * @param string $fraud_module + * @param boolean $fraud_module_status + * @param string $payment_type + */ + public static function gotoPaymentOnCallback($fraud_module, $fraud_module_status, $payment_type) { + if (in_array($fraud_module, array('CALLBACK', 'SMS')) && $fraud_module_status) { + $fraudModule_message = ($fraud_module == 'SMS') ? MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_PIN_INFO : MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_INFO; + $payment_error_return = 'payment_error=' . $payment_type . '&payment_message=' . $fraudModule_message; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Perform server XML request + * + * @param string $requesttype + * @param string $payment_type + * @return array + */ + public static function doCallbackRequest($requesttype, $payment_type) { + $vendor_details = self::getVendorDetails($payment_type); + $xml = ' + + + ' . $vendor_details['vendor'] . ' + ' . $vendor_details['auth_code'] . ' + ' . $requesttype . ' + ' . $_SESSION['novalnet'][$payment_type]['tid'] . ''; + if ($requesttype == 'PIN_STATUS') + $xml .= '' . trim($_SESSION['novalnet'][$payment_type][$payment_type . '_fraud_pin']) . ''; + $xml .= ''; + $xml_response = self::doPaymentCurlCall('https://payport.novalnet.de/nn_infoport.xml', $xml, false); + return $xml_response; + } + + /** + * Validate callback amount + * + * @param string $payment_module + * @param string $fraud_module + */ + public static function validateAmountOnCallback($payment_module, $fraud_module) { + $orderamount = self::getPaymentAmount(); + if ($_SESSION['novalnet'][$payment_module]['intial_order_amount'] != $orderamount) { + if (isset($_SESSION['novalnet'][$payment_module])) { + unset($_SESSION['novalnet'][$payment_module]); + } + $payment_error_return = 'payment_error=' . $payment_module . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_ERROR; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + if ($payment_module == 'novalnet_sepa' && $fraud_module && (MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ZEROAMOUNT')) { + $orderamount = 0; + } + } + + /** + * Return Invoice / Prepayment comments + * + * @param array $data + * @return array + */ + public static function formInvoicePrepaymentComments($data) { + $trans_comments = PHP_EOL . MODULE_PAYMENT_NOVALNET_INVOICE_COMMENTS_PARAGRAPH . PHP_EOL; + $trans_comments .= ($data['due_date'] != '') ? MODULE_PAYMENT_NOVALNET_DUE_DATE . date(DATE_FORMAT, strtotime($data['due_date'])) . PHP_EOL : ''; + $trans_comments .= MODULE_PAYMENT_NOVALNET_INV_PRE_ACCOUNT_HOLDER . PHP_EOL; + $trans_comments .= MODULE_PAYMENT_NOVALNET_IBAN . ': ' . $data['invoice_iban'] . PHP_EOL; + $trans_comments .= MODULE_PAYMENT_NOVALNET_BIC . ': ' . $data['invoice_bic'] . PHP_EOL; + $trans_comments .= MODULE_PAYMENT_NOVALNET_BANK . $data['invoice_bankname'] . ' ' . $data['invoice_bankplace'] . PHP_EOL; + $trans_comments .= MODULE_PAYMENT_NOVALNET_AMOUNT . xtc_format_price_order($data['amount'], 1, $data['currency']); + $bank_details = array( + 'tid' => $data['tid'], + 'account_holder' => 'NOVALNET AG', + 'bank_name' => $data['invoice_bankname'], + 'bank_city' => $data['invoice_bankplace'], + 'amount' => $data['amount'] * 100, + 'currency' => $data['currency'], + 'bank_iban' => $data['invoice_iban'], + 'bank_bic' => $data['invoice_bic'], + 'due_date' => $data['due_date'] + ); + return array( $trans_comments, $bank_details ); + } + + /** + * Perform order status update with custom order status (as per Merchant selection) + * + * @param integer $order_id + * @param string $payment_name + */ + public static function updateOrderStatus($order_id, $payment_name) { + global $order; + if (in_array($payment_name, array( 'novalnet_invoice','novalnet_prepayment' ))) { + $_SESSION['novalnet'][$payment_name]['payment_ref'] = array( + 'payment_reference1' => (constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_PAYMENT_REFERENCE1') == 'True') ? '1' : '0', + 'payment_reference2' => (constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_PAYMENT_REFERENCE2') == 'True') ? '1' : '0', + 'payment_reference3' => (constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_PAYMENT_REFERENCE3') == 'True') ? '1' : '0' + ); + $order->info['comments'] .= self::formInvoicePrepaymentPaymentReference(serialize($_SESSION['novalnet'][$payment_name]['payment_ref']), $payment_name); + } + $payment_order_status = in_array($_SESSION['novalnet'][$payment_name]['gateway_response']['tid_status'], array(85,86,90)) ?constant('MODULE_PAYMENT_'.strtoupper($payment_name).'_PENDING_ORDER_STATUS') : constant('MODULE_PAYMENT_' . strtoupper($payment_name) . '_ORDER_STATUS'); + // Update the Merchant selected order status in shop + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => $payment_order_status, + 'comments' => $order->info['comments'] + ), "update", "orders_id='$order_id'"); + xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, array( + 'orders_status_id' => $payment_order_status, + 'comments' => $order->info['comments'] + ), "update", "orders_id='$order_id'"); + } + + /** + * Build reference comments for invoice + * + * @param array $payment_reference + * @param string $payment_type + * @param array $datas + * @return string + */ + public static function formInvoicePrepaymentPaymentReference($payment_reference, $payment_type, $datas = '') { + global $insert_id; + $vendor_details = NovalnetHelper::getVendorDetails($payment_type); + $payment_reference = unserialize($payment_reference); + $payment_reference = array( $payment_reference['payment_reference1'], + $payment_reference['payment_reference2'], + $payment_reference['payment_reference3'], + ); + $payment_ref_comments = ''; + $enable_payment_reference = array_count_values($payment_reference); + $i = 1; + $info = array( + ('BNR-' . (isset($datas['product']) ? $datas['product'] : $vendor_details['product']) . '-' . (isset($datas['order_no']) ? $datas['order_no'] : $insert_id) . PHP_EOL), + 'TID ' . (isset($datas['tid']) ? $datas['tid'] . PHP_EOL : $_SESSION['novalnet'][$payment_type]['tid'] . PHP_EOL), + MODULE_PAYMENT_NOVALNET_ORDER_NUMBER . (isset($datas['order_no']) ? $datas['order_no'] : $insert_id) + ); + foreach ($payment_reference as $key => $value) { + if ($value == 1) { + $payment_ref_comments .= (($enable_payment_reference['1'] == '1') ? MODULE_PAYMENT_NOVALNET_INVPRE_REF . $info[$key] : sprintf(MODULE_PAYMENT_NOVALNET_INVPRE_REF_MULTI, ' ' . $i++) . ' ' . $info[$key]); + } + } + $reference_text = ($enable_payment_reference['1'] == '1') ? MODULE_PAYMENT_NOVALNET_PAYMENT_SINGLE_TEXT : MODULE_PAYMENT_NOVALNET_PAYMENT_MULTI_TEXT; + $payment_reference_comments = PHP_EOL . $reference_text . PHP_EOL . $payment_ref_comments; + return $payment_reference_comments; + } + + /** + * To process Affiliate account + * + * @param reference $urlparam + */ + public static function getAffDetails(&$urlparam) { + $_SESSION['novalnet']['nn_access_key'] = MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY; + if ($_SESSION['customer_id'] != '' && $_SESSION['customers_status']['customers_status_id'] != DEFAULT_CUSTOMERS_STATUS_ID_GUEST && (!isset($_SESSION['nn_aff_id']) || empty($_SESSION['nn_aff_id']))) { // To process affliate customers only + $affilated_details = xtc_db_fetch_array(xtc_db_query('SELECT aff_id FROM novalnet_aff_user_detail WHERE customer_id = "' . xtc_db_input($_SESSION['customer_id']) . '" ORDER BY id DESC LIMIT 1')); + if (isset($affilated_details['aff_id']) && !empty($affilated_details['aff_id'])) { // Set affilate id + $_SESSION['nn_aff_id'] = $affilated_details['aff_id']; // Assign affilate id from database + } + } + if (isset($_SESSION['nn_aff_id'])) { // Get affilate details + $affilated_details = xtc_db_fetch_array(xtc_db_query('SELECT aff_authcode, aff_accesskey FROM novalnet_aff_account_detail WHERE aff_id = "' . xtc_db_input($_SESSION['nn_aff_id']) . '"')); + if (trim($affilated_details['aff_accesskey'])!= '' && trim($affilated_details['aff_authcode']) != '' && $_SESSION['nn_aff_id'] != '') { // Assign access key for affilate id + $urlparam['vendor'] = $_SESSION['nn_aff_id']; + $urlparam['auth_code'] = $affilated_details['aff_authcode']; + $_SESSION['novalnet']['nn_access_key'] = $affilated_details['aff_accesskey']; // Assign affilate access key + } + } + } + + /** + * To proceed to second call for novalnet gateway + * + * @param array $datas + */ + public static function doSecondCallProcess($datas) { + self::logInitialTransaction($datas); // Insert transaction details to Novalnet table + if (isset($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['subs_id']) && $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['subs_id'] != '') { // If subscription order to insert the transaction details to Novalnet subscripton table + xtc_db_perform('novalnet_subscription_detail', array( + 'order_no' => $datas['order_no'], + 'subs_id' => $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['subs_id'], + 'tid' => $_SESSION['novalnet'][$datas['payment_type']]['tid'], + 'signup_date' => date('Y-m-d H:i:s'), + 'termination_reason' => '', + 'termination_at' => '' + ), "insert"); + } + if (isset($_SESSION['nn_aff_id'])) { // If affilate id customer to insert in transaction details to affliated table + xtc_db_perform('novalnet_aff_user_detail', array( + 'aff_id' => $_SESSION['nn_aff_id'], + 'customer_id' => $_SESSION['customer_id'], + 'aff_order_no' => $datas['order_no'] + ), 'insert'); + unset($_SESSION['nn_aff_id']); + } + self::doPaymentSecondCall($datas); // Order no to update the Novalnet server (do post back call) + } + + /** + * Get payment title + * + * @param string $payment + * @return string + */ + public static function getPaymentName($payment) { + $payment_title = array( + 'novalnet_cc' => 'CREDITCARD', + 'novalnet_sepa' => 'DIRECT_DEBIT_SEPA', + 'novalnet_invoice' => 'INVOICE_START', + 'novalnet_instantbank'=> 'ONLINE_TRANSFER', + 'novalnet_ideal' => 'IDEAL', + 'novalnet_paypal' => 'PAYPAL', + 'novalnet_przelewy24' => 'PRZELEWY24', + 'novalnet_prepayment' => 'INVOICE_START', + 'novalnet_eps' => 'EPS', + 'novalnet_giropay' => 'GIROPAY' + ); + return $payment_title[$payment]; + } + + /** + * To store Novalnet transaction details in table + * + * @param array $datas + */ + public static function logInitialTransaction($datas) { + self::testMailNotification($datas, $_SESSION['novalnet'][$datas['payment_type']]); + $amount = !empty($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['amount']) ? str_replace('.', '', $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['amount']) : $datas['recurring_amount']; + $payment_name = self::getPaymentName($datas['payment_type']); + xtc_db_perform('novalnet_transaction_detail', array( + 'tid' => !empty($_SESSION['novalnet'][$datas['payment_type']]['tid']) ? $_SESSION['novalnet'][$datas['payment_type']]['tid'] : $datas['recurring_tid'], + 'vendor' => !empty($_SESSION['novalnet'][$datas['payment_type']]['vendor_id'])?$_SESSION['novalnet'][$datas['payment_type']]['vendor_id'] : $datas['vendor'], + 'product' => !empty($_SESSION['novalnet'][$datas['payment_type']]['product_id']) ? $_SESSION['novalnet'][$datas['payment_type']]['product_id'] : $datas['product'], + 'tariff_id' => !empty($_SESSION['novalnet'][$datas['payment_type']]['tariff_id']) ? $_SESSION['novalnet'][$datas['payment_type']]['tariff_id'] : $datas['tariff_id'] , + 'auth_code' => !empty($_SESSION['novalnet'][$datas['payment_type']]['authcode'])? $_SESSION['novalnet'][$datas['payment_type']]['authcode'] : $datas['auth_code'] , + 'subs_id' => !empty($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['subs_id']) ? $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['subs_id'] : $datas['subs_id'] , + 'payment_id' => !empty($_SESSION['novalnet'][$datas['payment_type']]['payment_id']) ? $_SESSION['novalnet'][$datas['payment_type']]['payment_id'] : $datas['payment_id'] , + 'payment_type' => $datas['payment_type'], + 'amount' => (!empty($amount)) ? $amount : 0, + 'currency' => !empty($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['currency']) ? $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['currency'] : $datas['currency'] , + 'gateway_status' => !empty($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['tid_status']) ? $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['tid_status'] : $datas['tid_status'] , + 'order_no' => !empty($datas['new_order_no']) ? $datas['new_order_no'] : $datas['order_no'], + 'novalnet_order_date' => date('Y-m-d H:i:s'), + 'test_mode' => (((isset($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['test_mode']) && $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['test_mode'] == 1) || ($datas['test_mode'] == 1 )) ? 1 : 0), + 'payment_details' => !empty($_SESSION['novalnet'][$datas['payment_type']]['serialize_data']) ? $_SESSION['novalnet'][$datas['payment_type']]['serialize_data'] : $datas['invoice_payment_details'], + 'customer_id' => !empty($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['customer_no']) ? $_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['customer_no'] : $datas['customer_id'] , + 'reference_transaction' => isset($_SESSION['novalnet'][$datas['payment_type']]['reference_transaction']) ? $_SESSION['novalnet'][$datas['payment_type']]['reference_transaction'] : 0, + 'payment_ref' => isset($_SESSION['novalnet'][$datas['payment_type']]['payment_ref']) ? serialize($_SESSION['novalnet'][$datas['payment_type']]['payment_ref']) : (!empty($datas['payment_ref']) ? $datas['payment_ref'] : ''), + 'next_payment_date' => isset($_SESSION['novalnet'][$datas['payment_type']]['next_payment_date'])? $_SESSION['novalnet'][$datas['payment_type']]['next_payment_date'] : (!empty($datas['next_payment_date']) ? $datas['next_payment_date'] : ''), + 'process_key' => !empty($_SESSION['novalnet'][$datas['payment_type']]['process_key']) ? $_SESSION['novalnet'][$datas['payment_type']]['process_key'] : '', + 'refund_amount' => !empty($datas['refund_amount']) ? $datas['refund_amount'] : '' + ), "insert"); + xtc_db_perform('novalnet_callback_history', array( + 'callback_datetime' => date('Y-m-d H:i:s'), + 'payment_type' => (($_SESSION['novalnet'][$datas['payment_type']]['payment_id'] == 41 ) ? 'GUARANTEED_INVOICE_START' : (($_SESSION['novalnet'][$datas['payment_type']]['payment_id'] == 40) ? 'GUARANTEED_DIRECT_DEBIT_SEPA' : $payment_name)), + 'original_tid' => !empty($_SESSION['novalnet'][$datas['payment_type']]['tid']) ? $_SESSION['novalnet'][$datas['payment_type']]['tid'] : $datas['recurring_tid'], + 'callback_tid' => '', + 'order_amount' => (!empty($amount)) ? $amount : 0, + 'callback_amount' =>(in_array($datas['payment_type'], array('novalnet_invoice', 'novalnet_prepayment')) || in_array($_SESSION['novalnet'][$datas['payment_type']]['gateway_response']['tid_status'], array(85,86,90)) || (!empty($datas['tid_status']) && $datas['tid_status'] == 90) ) ? '0' : $amount, + 'order_no' => !empty($datas['new_order_no']) ? $datas['new_order_no'] : $datas['order_no'], + ), "insert"); + } + + /** + * Perform Paygate second call for updating order_no in novalnet server + * + * @param array $datas + */ + public static function doPaymentSecondCall($datas) { + $urlparam = array( + 'vendor' => $_SESSION['novalnet'][$datas['payment_type']]['vendor_id'], + 'product' => $_SESSION['novalnet'][$datas['payment_type']]['product_id'], + 'auth_code' => $_SESSION['novalnet'][$datas['payment_type']]['authcode'], + 'tariff' => $_SESSION['novalnet'][$datas['payment_type']]['tariff_id'], + 'key' => $_SESSION['novalnet'][$datas['payment_type']]['payment_id'], + 'status' => 100, + 'tid' => $_SESSION['novalnet'][$datas['payment_type']]['tid'], + 'order_no' => $datas['order_no'] + ); + if (in_array($datas['payment_type'], array('novalnet_invoice', 'novalnet_prepayment'))) { + $urlparam['invoice_ref'] = 'BNR-' . $urlparam['product'] . '-' . $datas['order_no']; + } + self::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparam, false); + if (isset($_SESSION['novalnet'])) { + unset($_SESSION['novalnet']); + } + } + + /** + * Encode the config parameters before transaction. + * + * @param array $datas + * @param array $encoded_values + */ + public static function generateHashValue(&$datas,$encoded_values) { + $datas['uniqid'] = time(); + foreach ( $encoded_values as $value ) { + $data = $datas[ $value ]; + try { + $crc = sprintf('%u', crc32( $data ) ); + $data = $crc . "|" . $data; + $data = bin2hex( $data . trim($_SESSION['novalnet']['nn_access_key'])); + $data = strrev( base64_encode( $data) ); + } catch ( Exception $e ) { + echo('Error: ' . $e ); + } + $datas[ $value ] = $data; + } + $datas['hash'] = self::generatemd5Value($datas); + } + + /** + * Perform the decoding process for redirection payment methods + * + * @param array $data + * @return string + */ + public static function generateDecode($data) { + try { + $data = base64_decode(strrev($data)); + $data = pack("H" . strlen($data), $data); + $data = substr($data, 0, stripos($data, trim($_SESSION['novalnet']['nn_access_key']))); + $pos = strpos($data, "|"); + if ($pos === false) { + return ("Error: CKSum not found!"); + } + $crc = substr($data, 0, $pos); + $value = trim(substr($data, $pos + 1)); + if ($crc != sprintf('%u', crc32($value))) { + return ("Error; CKSum invalid!"); + } + return $value; + } + catch (Exception $e) { + echo ('Error: ' . $e); + } + return $data; + } + + /** + * To generate the HASH value + * + * @param array $data + * @return string + */ + public static function generatemd5Value($data) { + return md5($data['auth_code'] . $data['product'] . $data['tariff'] . $data['amount'] . $data['test_mode'] . $data['uniqid'] . strrev(trim($_SESSION['novalnet']['nn_access_key']))); + } + + /** + * To get Novalnet transaction information from novalnet table + * + * @param integer $order_no + * @return array + */ + public static function getNovalnetTransDetails($order_no) { + return xtc_db_fetch_array(xtc_db_query("SELECT tid, vendor, product, tariff_id, auth_code, refund_amount,subs_id, payment_id, payment_type, amount, currency, gateway_status, novalnet_order_date, test_mode, customer_id, payment_details,payment_ref,next_payment_date,order_no FROM novalnet_transaction_detail WHERE order_no='" . xtc_db_input($order_no) . "'")); + } + + /** + * To form server response in session and transaction comments while processing one click shopping + * + * @param string $paymentname + * @param array $params + * @param array $payment_response + */ + public static function getPostValues($paymentname, $params, $payment_response) { + global $order; + $serialize_data = ''; + if($paymentname == 'novalnet_cc' && constant('MODULE_PAYMENT_'.strtoupper($paymentname).'_SHOP_TYPE') == 'ONECLICK' && !empty($params['create_payment_ref'])) { + $serialize_data = ($paymentname == 'novalnet_cc') ? serialize(array( + 'cc_holder' => $payment_response['cc_holder'], + 'cc_no' => $payment_response['cc_no'], + 'cc_exp_year' => $payment_response['cc_exp_year'], + 'cc_exp_month' => $payment_response['cc_exp_month'], + 'tid_status' => $payment_response['tid_status'], + 'cc_card_type' => $payment_response['cc_card_type'], + 'tid' => $payment_response['tid'] )) + : ''; + } + $_SESSION['novalnet'][$paymentname] = array( + 'vendor_id' => $params['vendor'], + 'product_id' => $params['product'], + 'authcode' => $params['auth_code'], + 'tariff_id' => $params['tariff'], + 'tid' => $payment_response['tid'], + 'payment_id' => $params['key'], + 'test_mode' => $payment_response['test_mode'], + 'reference_transaction' => ( isset($_SESSION['novalnet'][$paymentname]['reference_transaction']) ) ? '1' : '0', + 'gateway_response' => $payment_response, + 'gateway_response' => $payment_response, + 'next_payment_date' => $payment_response['next_subs_cycle'], + 'serialize_data' => !empty($_SESSION['novalnet'][$paymentname]['serialize_data']) ? $_SESSION['novalnet'][$paymentname]['serialize_data'] : $serialize_data, + ); + $user_comments = !empty($order->info['comments']) ? PHP_EOL . $order->info['comments'] : ''; + $trans_comments = self::transactionCommentsForm($payment_response, $paymentname ); + $order->info['comments'] = $user_comments . $trans_comments; + } + + /** + * Form Novalnet transactions comments + * + * @param array $response + * @param string $paymentname + * @return string + */ + public static function transactionCommentsForm ($response,$paymentname) { + $trans_comments = PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS . PHP_EOL . MODULE_PAYMENT_NOVALNET_TRANSACTION_ID . $response['tid'] . ((($response['test_mode'] == 1) || constant('MODULE_PAYMENT_' . strtoupper($paymentname) . '_TEST_MODE') == 'True') ? PHP_EOL . MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE . PHP_EOL : ''); + return $trans_comments; + } + + /** + * To show javascript error message if not enable javascript in browser + * + * @return string + */ + public static function enableJavascript() { + return ''; + } + + /** + * To send test mail notification to Merchant + * + * @param $paymentname + * @param $response + */ + public static function testMailNotification($datas, $response) { + if((constant('MODULE_PAYMENT_' . strtoupper($datas['payment_type']) . '_TEST_MODE') == 'False' && $response['test_mode'] == 1 ) && MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION == 'True') { + xtc_php_mail(EMAIL_FROM, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, '', '', '', '', '', sprintf(MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_HEADING,STORE_NAME), sprintf(MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_CONTENT, $datas['order_no']),''); + } + } + + /** + * Get server response + * + * @param array $response + * return string + */ + public static function getServerResponse($response) { + return (!empty($response['status_desc']) ? $response['status_desc'] : (!empty($response['status_text']) ? $response['status_text'] : (!empty($response['status_message']) ? $response['status_message'] : MODULE_PAYMENT_NOVALNET_TRANSACTION_ERROR))); + } +} + diff --git a/includes/external/novalnet/css/novalnet.css b/includes/external/novalnet/css/novalnet.css new file mode 100644 index 0000000..fafba25 --- /dev/null +++ b/includes/external/novalnet/css/novalnet.css @@ -0,0 +1,11 @@ +.novalnet_loader { + position: fixed; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + z-index: 9999; + background: url('../../../../images/icons/novalnet/nn_loader.gif') 50% 50% no-repeat; +} +.form-group:nth-child(0) { + display: none;} diff --git a/includes/external/novalnet/js/jquery.js b/includes/external/novalnet/js/jquery.js new file mode 100644 index 0000000..73f33fb --- /dev/null +++ b/includes/external/novalnet/js/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("'. + xtc_draw_hidden_field('', DIR_WS_CATALOG, 'id="nn_root_cc_catalog"'). + xtc_draw_hidden_field('nn_pan_hash', '', 'id="nn_pan_hash"'). + xtc_draw_hidden_field('nn_cc_uniqueid', '', 'id="nn_cc_uniqueid"') + .xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER), 'id="nn_css_card_holder"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_INPUT), 'id="nn_css_holder_input"'). xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER), 'id="nn_css_card_no"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_INPUT), 'id="nn_css_card_no_input"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE), 'id="nn_css_expiry_date"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_INPUT), 'id="nn_css_expiry_date_input"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC), 'id="nn_css_cvc"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_INPUT), 'id="nn_css_cvc_input"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE), 'id="nn_css_standard"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_INPUT), 'id="nn_css_standard_input"'). + xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_CSS_TEXT), 'id="nn_css_text"').xtc_draw_hidden_field('', trim(MODULE_PAYMENT_NOVALNET_CC_SHOP_TYPE), 'id="nn_form_mode"') .xtc_draw_hidden_field('', trim(defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_HINT') ? MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_HINT : '' ), 'id="nn_iframe_cvc_hint"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_ERROR') ? trim(MODULE_PAYMENT_NOVALNET_CC_IFRAME_ERROR) : '', 'id="nn_iframe_error"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER') ? trim(MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER) : '', 'id="nn_iframe_holder_label"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_HOLDER_INPUT_TEXT')? trim(MODULE_PAYMENT_NOVALNET_CC_IFRAME_HOLDER_INPUT_TEXT) : '', 'id="nn_iframe_holder_input"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO') ? trim(MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO) : '', 'id="nn_iframe_number_label"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_NUMBER_INPUT_TEXT') ? trim(MODULE_PAYMENT_NOVALNET_CC_IFRAME_NUMBER_INPUT_TEXT) : '', 'id="nn_iframe_number_input"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE') ? trim(MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE): '', 'id="nn_iframe_expire_label"').xtc_draw_hidden_field('',defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_EXPIRYDATE_INPUT_TEXT') ? trim(MODULE_PAYMENT_NOVALNET_CC_IFRAME_EXPIRYDATE_INPUT_TEXT) : '', 'id="nn_iframe_expire_input"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC') ? trim(MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC) :'', 'id="nn_iframe_cvc_label"').xtc_draw_hidden_field('', defined('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_INPUT_TEXT') ? trim(MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_INPUT_TEXT) : '', 'id="nn_iframe_cvc_input"'); + } +} + diff --git a/includes/modules/payment/novalnet_config.php b/includes/modules/payment/novalnet_config.php new file mode 100644 index 0000000..d844450 --- /dev/null +++ b/includes/modules/payment/novalnet_config.php @@ -0,0 +1,199 @@ +code = 'novalnet_config'; + $this->title = MODULE_PAYMENT_NOVALNET_CONFIG_TEXT_TITLE; + $this->description = MODULE_PAYMENT_NOVALNET_CONFIG_TEXT_DESCRIPTION; + $this->sort_order = 0; + $this->enabled = false; + } + + /** + * Checks for payment installation status + * + * @return boolean + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_PUBLIC_KEY'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Payment module installation + * + * @return boolean + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . "(configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) VALUES + ('MODULE_PAYMENT_NOVALNET_PUBLIC_KEY', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_CONFIG_ALIAS', 'NN_CONFIG', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_VENDOR_ID', '', '6', '2', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_AUTHCODE', '', '6', '3', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRODUCT_ID', '', '6', '4', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_TARIFF_ID', '', '6', '5', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY', '', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT', '', '6', '7', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION','False', '6', '8', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION\'," . MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION . ",','',now()), + ('MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION','False', '6', '9', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION\'," . MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_PROXY', '', '6', '10', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT', '240', '6', '11', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_REFERRER_ID', '', '6', '12', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY','True', '6', '13', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY\'," . MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE', '0', '6', '14', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED', '0', '6', '15', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name',now()), + ('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD', '', '6', '16', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT', '', '6', '17', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2', '', '6', '18', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL', '0', '6', '19', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name',now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE','False', '6', '20', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE\'," . MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE . ",','',now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE','False', '6', '21', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE . ",','',now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND','False', '6', '22', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE,),\'MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND\'," . MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO', '', '6', '23','','', now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC', '', '6', '24','','', now()), + ('MODULE_PAYMENT_NOVALNET_CONFIG_ALLOWED', '', '6', '25', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_CALLBACK_URL', '" . ((defined('ENABLE_SSL_CATALOG') && ENABLE_SSL_CATALOG === true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG) . 'callback/novalnet/callback.php' . "','6', '26','','', now())"); + $this->installQuery(); + } + + /** + * Payment module uninstallation + * + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_CONFIG_ALLOWED','MODULE_PAYMENT_NOVALNET_CONFIG_ALIAS'))) . "')"); + } + + /** + * Return keys to display in payment configuration (Backend) + * + * @return boolean + */ + function keys() { + global $gx_version; // Get gambio version + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false && !$_SESSION['novalnet']['api'] && $_GET['module'] == $this->code) { + $_SESSION['novalnet']['api'] = true; + $server_ip = NovalnetHelper::getIpAddress($_SERVER['SERVER_ADDR']); + echo ''; + } + if(!empty($_SESSION['novalnet']['api']) && empty($_REQUEST['action'])) { + unset($_SESSION['novalnet']['api']); + } + if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && isset($_SESSION['flag'])) { + unset($_SESSION['flag']); + } + // Validate the merchant configuration in shop backend + if (!$_SESSION['flag']) { + NovalnetHelper::validateMerchantConfiguration(); + } + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_CONFIG_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_PUBLIC_KEY', + 'MODULE_PAYMENT_NOVALNET_VENDOR_ID', + 'MODULE_PAYMENT_NOVALNET_AUTHCODE', + 'MODULE_PAYMENT_NOVALNET_PRODUCT_ID', + 'MODULE_PAYMENT_NOVALNET_TARIFF_ID', + 'MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY', + 'MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT', + 'MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION', + 'MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION', + 'MODULE_PAYMENT_NOVALNET_PROXY', + 'MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT', + 'MODULE_PAYMENT_NOVALNET_REFERRER_ID', + 'MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY', + 'MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE', + 'MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED', + 'MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD', + 'MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2', + 'MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC', + 'MODULE_PAYMENT_NOVALNET_CALLBACK_URL' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_CONFIG_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } + + /** + * Installing Novalnet tables + */ + function installQuery() { + $novalnet_check = xtc_db_query('DESC ' . TABLE_ADMIN_ACCESS); + $novalet_alter_table = false; + // Check novalnet column in admin access table + while ($check_column = xtc_db_fetch_array($novalnet_check)) { + if (in_array($check_column['Field'], array('novalnet_extension_helper','novalnet'))) { + $novalet_alter_table = true; + break; + } + } + if (!$novalet_alter_table) { + xtc_db_query("ALTER TABLE " . TABLE_ADMIN_ACCESS . " ADD novalnet int(1) NOT NULL DEFAULT '1',COMMENT='Novalnet Admin page'"); + xtc_db_query("ALTER TABLE " . TABLE_ADMIN_ACCESS . " ADD novalnet_extension_helper int(1) NOT NULL DEFAULT '1',COMMENT='Novalnet Admin extension'"); + } + // Import Novalnet package SQL tables + $sql_file = DIR_FS_CATALOG . 'includes/external/novalnet/sql/db.sql'; + $sql_lines = file_get_contents($sql_file); + $sql_linesArr = explode(";", $sql_lines); + foreach ($sql_linesArr as $sql) { + if (trim($sql) > '') { + xtc_db_query($sql); + } + } + // Check wheather novalnet table exist in shop + $nn_check = xtc_db_query('DESC ' . 'novalnet_callback_history'); + $nn_alter_table = false; + while ($checks_column = xtc_db_fetch_array($nn_check)) { + if (in_array($checks_column['Field'] ,array('callback_datetime','original_tid','order_amount','callback_amount'))) { + $nn_alter_table = true; + break; + } + } + // Alter the novalnet table if already exists in shop + if (!$nn_alter_table) { + xtc_db_query('ALTER TABLE novalnet_callback_history CHANGE org_tid original_tid bigint(20) unsigned COMMENT "Original Transaction ID"'); + xtc_db_query('ALTER TABLE novalnet_callback_history CHANGE amount order_amount int(20) COMMENT "Amount in minimum unit of currency. E.g. enter 100 which is equal to 1.00"'); + xtc_db_query('ALTER TABLE novalnet_callback_history CHANGE total_amount callback_amount int(11) COMMENT "Amount in minimum unit of currency. E.g. enter 100 which is equal to 1.00"'); + xtc_db_query('ALTER TABLE novalnet_callback_history CHANGE `date` callback_datetime datetime COMMENT "Callback excute DATE TIME"'); + } + } +} + diff --git a/includes/modules/payment/novalnet_eps.php b/includes/modules/payment/novalnet_eps.php new file mode 100644 index 0000000..1810245 --- /dev/null +++ b/includes/modules/payment/novalnet_eps.php @@ -0,0 +1,289 @@ +code = 'novalnet_eps'; + $this->title = MODULE_PAYMENT_NOVALNET_EPS_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_EPS_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE == 'True'); // To check the test mode + $this->form_action_url = 'https://payport.novalnet.de/giropay'; + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) { + $this->update_status(); + } + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + * + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return payment form + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_REDIRECT_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process and generate the redirect params + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { // Generate the redirect params + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + // Get the common payment params + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode); + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else { // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + // To validate the response + $before_process_response = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = $before_process_response['novalnet_comments']; + } + } + + /** + * Core Function : after_process() + * + * Send post back params(acknowledgement) to Novalnet server + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => utf8_decode($error_message) + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + * @return boolean + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_EPS_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + * @return boolean + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_EPS_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_ALIAS', 'NN_EPS', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE', '0', '6', '8', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1', '', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2', '', '6', '10', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_EPS_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + * @return boolean + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_EPS_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_EPS_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_EPS_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_giropay.php b/includes/modules/payment/novalnet_giropay.php new file mode 100644 index 0000000..0a28381 --- /dev/null +++ b/includes/modules/payment/novalnet_giropay.php @@ -0,0 +1,288 @@ +code = 'novalnet_giropay'; + $this->title = MODULE_PAYMENT_NOVALNET_GIROPAY_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_GIROPAY_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE == 'True'); // To check the test mode + $this->form_action_url = 'https://payport.novalnet.de/giropay'; + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) { + $this->update_status(); + } + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_REDIRECT_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process and generate the redirect params + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { // Generate the redirect params + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + // Get the common payment params + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode); + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else { // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + // To validate the response + $form_comments = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } + } + + /** + * Core Function : after_process() + * + * Send post back params(acknowledgement) to Novalnet server + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => utf8_decode($error_message) + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + * @return boolean + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + * @return boolean + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_ALIAS', 'NN_GIRO', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE', '0', '6', '8', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1', '', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2', '', '6', '10', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_GIROPAY_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + * @return boolean + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_GIROPAY_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_GIROPAY_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_ideal.php b/includes/modules/payment/novalnet_ideal.php new file mode 100644 index 0000000..8dbed71 --- /dev/null +++ b/includes/modules/payment/novalnet_ideal.php @@ -0,0 +1,289 @@ +code = 'novalnet_ideal'; + $this->title = MODULE_PAYMENT_NOVALNET_IDEAL_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_IDEAL_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE == 'True'); // To check the test mode + $this->form_action_url = 'https://payport.novalnet.de/online_transfer_payport'; + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) { + $this->update_status(); + } + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_REDIRECT_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process and generate the redirect params + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { // Generate the redirect params + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + // Get the common payment params + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode); + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + $urlparam['payment_type'] = 'IDEAL'; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else { // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + // To validate the response + $form_comments = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } + } + + /** + * Core Function : after_process() + * + * Send post back params(acknowledgement) to Novalnet server + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => html_entity_decode($error_message) + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + * @return boolean + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + * @return boolean + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_ALIAS', 'NN_ID', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE', '0', '6', '8', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1', '', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2', '', '6', '10', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_IDEAL_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + * @return boolean + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_IDEAL_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_IDEAL_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_instantbank.php b/includes/modules/payment/novalnet_instantbank.php new file mode 100644 index 0000000..943c652 --- /dev/null +++ b/includes/modules/payment/novalnet_instantbank.php @@ -0,0 +1,290 @@ +code = 'novalnet_instantbank'; + $this->title = MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_INSTANTBANK_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE == 'True'); // To check the test mode + $this->form_action_url = 'https://payport.novalnet.de/online_transfer_payport'; + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return payment form + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_REDIRECT_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process and generate the redirect params + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { // Generate the redirect params + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + // Get the common payment params + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode); + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else { // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + // To validate the response + $form_comments = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } + } + + /** + * Core Function : after_process() + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => html_entity_decode($error_message) + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + * @return boolean + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + + } + + /** + * Core Function : install() + * + * Payment module installation + * @return boolean + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALIAS', 'NN_IB', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE', '0', '6', '8', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1', '', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2', '', '6', '10', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + * @return boolean + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_invoice.php b/includes/modules/payment/novalnet_invoice.php new file mode 100644 index 0000000..576be6d --- /dev/null +++ b/includes/modules/payment/novalnet_invoice.php @@ -0,0 +1,512 @@ +code = 'novalnet_invoice'; + $this->title = MODULE_PAYMENT_NOVALNET_INVOICE_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_INVOICE_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_INVOICE_SORT_ORDER') && trim(MODULE_PAYMENT_NOVALNET_INVOICE_SORT_ORDER) != '' ? trim(MODULE_PAYMENT_NOVALNET_INVOICE_SORT_ORDER) : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_MODULE == 'True'); + $this->fraud_module = ((MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE == 'False') ? false : MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_INVOICE_TEST_MODE == 'True'); // To check the test mode + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + global $order; + // Get order amount + if(!empty($order)) { + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // Unset the novalnet session variable + if (isset($_SESSION['novalnet'][$this->code]['tid']) && !empty($_SESSION['payment']) && $_SESSION['payment'] != $this->code) { + unset($_SESSION['novalnet'][$this->code]['tid']); + } + // Payment hide in checkout page when condition was true if fraud module enable + if (!empty($_SESSION[$this->code . '_payment_lock_nn']) && isset($_SESSION[$this->code . '_callback_max_time_nn']) && $_SESSION[$this->code . '_callback_max_time_nn'] > time()) { + return false; + } + // Unset the fraud module session variable + if (isset($_SESSION['novalnet'][$this->code]['tid']) && !empty($_SESSION[$this->code . '_payment_lock_nn']) && isset($_SESSION[$this->code . '_callback_max_time_nn']) && $_SESSION[$this->code . '_callback_max_time_nn'] < time()) { + unset($_SESSION[$this->code . '_callback_max_time_nn'], $_SESSION[$this->code . '_payment_lock_nn'], $_SESSION['novalnet'][$this->code]['tid']); + } + // Get order amount set for fraud module validation + if(empty($_SESSION['novalnet']['novalnet_invoice']['nn_set_order_amount']) || (empty($_REQUEST['payment']) && !empty($_SESSION['novalnet']['novalnet_invoice']['nn_set_order_amount']) && $order_amount != $_SESSION['novalnet']['novalnet_invoice']['nn_order_amount'])) { + $_SESSION['novalnet']['novalnet_invoice']['nn_set_order_amount'] = true; + $_SESSION['novalnet']['novalnet_invoice']['nn_order_amount'] = $order_amount; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_INVOICE_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_INVOICE_ENDCUSTOMER_INFO)) : ''; + if(!empty($order)){ + $gurantee_error = $this->proceedToInvoiceGuranteePayment($order_amount); + } + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_INV_PRE_DESC . '
' . $test_mode .'
'. $endcustomerinfo.'
'.$gurantee_error.'
'); + //To check the basic fraud module requirements + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_invoice']['nn_order_amount']); + if ($_SESSION['novalnet'][$this->code]['tid'] == '' && in_array($this->fraud_module,array('CALLBACK', 'SMS')) && $this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + if ($this->fraud_module == 'CALLBACK') { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_CALLBACK_INPUT_TITLE, + 'field' => '
'. xtc_draw_input_field($this->code . '_fraud_tel', $order->customer['telephone'], 'id="' . $this->code . '_' .strtolower($this->fraud_module).'" AUTOCOMPLETE=off') . '
' + ); + } else { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_INPUT_TITLE, + 'field' => '
'. xtc_draw_input_field($this->code . '_fraud_mobile', '', 'id="' . $this->code . '_' .strtolower($this->fraud_module).'pin'.'" AUTOCOMPLETE=off').'
' + ); + } + } + // Fraud module pin box showing in checkout page if fraud module enable + if (isset($_SESSION['novalnet'][$this->code]['tid']) && in_array($this->fraud_module,array('CALLBACK', 'SMS')) && $this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_REQUEST_DESC, + 'field' => '
'.xtc_draw_input_field($this->code . '_fraud_pin', '', 'id="' . $this->code . '_' . strtolower($this->fraud_module) . 'pin"AUTOCOMPLETE=off').'
' + ); + $selection['fields'][] = array( + 'title' => '', + 'field' => xtc_draw_checkbox_field($this->code . '_new_pin', '1', false, 'id="' . $this->code . '_' . strtolower($this->fraud_module) . 'new_pin"') . MODULE_PAYMENT_NOVALNET_FRAUDMODULE_NEW_PIN, + ); + + } + // Get the customer id for to get end customer dob in database + $customer_id = (isset($_SESSION['customer_id'])) ? 'customers_id= "' . xtc_db_input($_SESSION['customer_id']) . '"' : 'customers_email_address= "' . xtc_db_input($order->customer['email_address']) . '"'; + $customer_dbvalue = xtc_db_fetch_array(xtc_db_query("SELECT customers_dob FROM " . TABLE_CUSTOMERS . " WHERE " . $customer_id . " ORDER BY customers_id DESC")); + $customer_dbvalue['customers_dob'] = !in_array($customer_dbvalue['customers_dob'] ,array('0000-00-00 00:00:00','1000-01-01 00:00:00')) ? date('Y-m-d', strtotime($customer_dbvalue['customers_dob'])) :''; + // To show the gurantee payment field + if (!empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_GUARANTEE_FIELD, + 'field' => '
'.xtc_draw_input_field($this->code.'_dob',$customer_dbvalue['customers_dob'], 'id="'.$this->code.'_dob" AUTOCOMPLETE=off').'
' + ); + } + return $selection; + } + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + */ + function pre_confirmation_check() { + global $order; + $post = $_REQUEST; + $_SESSION['novalnet'][$this->code . '_newpin'] = $post[$this->code . '_new_pin']; + //To check the basic fraud module requirements + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_invoice']['nn_order_amount']); + // if javascript not enable in system then show the error message + if (!empty($post['js_enabled'])) { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_NO_SCRIPT; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + //To validate the fraud module pin field + if ($this->fraud_module_status && !empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1 && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + NovalnetHelper::validateUserInputsOnCallback($this->code, $post, $this->fraud_module); + } else if (empty($_SESSION['novalnet'][$this->code]['tid'])) { // To performing the first call process + // To validate the fraud module tel/sms fields + if ($this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $error_message = NovalnetHelper::validateCallbackFields($post, $this->fraud_module, $this->code); + if ($error_message != '') { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . trim($error_message); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + //To validate the gurantee payment field + $error_message= ''; + //To validate the gurantee payment field + if (!empty($_SESSION['novalnet'][$this->code]['guarantee']) && !empty($_SESSION['novalnet'][$this->code]['guarantee_error'])) { + $error_message = MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_ERROR; + } elseif (!empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $current_age = date('Y-m-d',strtotime($post['novalnet_invoice_dob'])); + if ($post['novalnet_invoice_dob'] == '') { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_EMPTY_ERROR_MESSAGE; + } else if(!preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$post['novalnet_invoice_dob'])) { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_INVAILD_DOB_ERROR_MESSAGE; + } else if ($post['novalnet_invoice_dob'] != '') { + if(time() < strtotime('+18 years', strtotime($current_age)) && MODULE_PAYMENT_NOVALNET_INVOICE_FORCE == 'False') { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_AGE_ERROR_MESSAGE; + } else if (!NovalnetHelper::validateDuedate(trim($post['novalnet_invoice_dob']))) { // Validate dob field + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_ERROR_MESSAGE; + } + } + } + if($error_message != '' && MODULE_PAYMENT_NOVALNET_INVOICE_FORCE == 'False'){ + unset($_SESSION['payment'],$_SESSION['novalnet'][$this->code]['guarantee']); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error_message=' . $error_message, 'SSL', true, false)); + } + } + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @param none + * @return boolean + */ + function confirmation() { + global $order; + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + // To check the basic fraud module requirements + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_invoice']['nn_order_amount']); + if ($this->fraud_module_status && !empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1 && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + NovalnetHelper::validateAmountOnCallback($this->code, $this->fraud_module); + } + + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + $post = $_REQUEST; + // To generate the new pin for fraud module + if (isset($post[$this->code . '_new_pin']) && $post[$this->code . '_new_pin'] == 1) { // Generate the new pin for fraud module + $new_pin_response = NovalnetHelper::doCallbackRequest('TRANSMIT_PIN_AGAIN', $this->code); + $response = simplexml_load_string($new_pin_response); + $response = json_decode(json_encode($response), true); + $response_text = isset($response['status_message']) ? $response['status_message'] : (isset($response['pin_status']['status_message']) ? $response['pin_status']['status_message'] : $response['status_text']); + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . $response_text; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } elseif (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { //Store the values in session + $novalnet_order_details = !empty($_SESSION['novalnet'][$this->code]) ? $_SESSION['novalnet'][$this->code] : array(); + $_SESSION['novalnet'][$this->code] = array_merge($novalnet_order_details, $post, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + } else { // Payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function before_process() { + global $order; + $order_amount = NovalnetHelper::getPaymentAmount(); + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_invoice']['nn_order_amount']); + $param_inputs = array_merge((array) $order, $_SESSION['novalnet'][$this->code], array( + 'fraud_module' => $this->fraud_module, + 'fraud_module_status' => $this->fraud_module_status + )); + // Fraud module call request send to the novalnet server + if (!empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1) { + $callback_response = NovalnetHelper::doCallbackRequest('PIN_STATUS', $this->code); + $callback_response = simplexml_load_string($callback_response); + $callback_response = json_decode(json_encode($callback_response), true); + $_SESSION['novalnet'][$this->code]['gateway_response']['tid_status'] = $callback_response['tid_status']; + $callback_response_text = isset($callback_response['status_message']) ? $callback_response['status_message'] : (isset($callback_response['pin_status']['status_message']) ? $callback_response['pin_status']['status_message'] : $callback_response['status_text']); + if ($callback_response['status'] != 100) { + if ($callback_response['status'] == '0529006') { + $_SESSION[$this->code . '_payment_lock_nn'] = true; + $_SESSION[$this->code . '_callback_max_time_nn'] = time() + (30 * 60); + } + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . $callback_response_text; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } else { // Normal payment request send to the novalnet server + $urlparam = NovalnetHelper::getCommonParms($param_inputs); + $urlparam['invoice_type'] = 'INVOICE'; + // To send the invoice due date to novalnet server + if (trim(MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE) != '' && ctype_digit(trim(MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE))) { + $urlparam['due_date'] = date("Y-m-d", strtotime(trim(MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE) . ' days')); + } + // To process on hold product + if (trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT) > 0 && $order_amount >= trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT)) { // If condition true then order proceed on-hold transaction + $urlparam['on_hold'] = 1; + } + //Fraud module param send to the novalnet server + if ($this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { // Allow fraud module param if enabled + if ($this->fraud_module == 'CALLBACK') { // if fraud module callback enabled + $urlparam['tel'] = trim($_SESSION['novalnet'][$this->code]['novalnet_invoice_fraud_tel']); + $urlparam['pin_by_callback'] = '1'; + } else { // if fraud module sms enabled + $urlparam['mobile'] = trim($_SESSION['novalnet'][$this->code]['novalnet_invoice_fraud_mobile']); + $urlparam['pin_by_sms'] = '1'; + } + } + //The gurantee payment param send to the novalnet server + if (!empty($_SESSION['novalnet'][$this->code]['guarantee']) && !empty($_SESSION['novalnet'][$this->code]['novalnet_invoice_dob']) && (time() > strtotime('+18 years', strtotime(date('Y-m-d',strtotime($_SESSION['novalnet'][$this->code]['novalnet_invoice_dob'])))) && NovalnetHelper::validateDuedate(trim($_SESSION['novalnet'][$this->code]['novalnet_invoice_dob'])))) { // To process guarantee payments + $urlparam['key'] = 41; + $urlparam['birth_date'] = (date('Y-m-d', strtotime($_SESSION['novalnet'][$this->code]['novalnet_invoice_dob']))); + $urlparam['payment_type'] = 'GUARANTEED_INVOICE_START'; + } + // Payment call request send to the novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparam); + parse_str($response, $data); + // Form the novalnet transaction comments and transaction details are stored in session variable + $form_comments = NovalnetHelper::checkPaymentStatus($this->code, $data,$urlparam); + // To process the fraud module on first call + NovalnetHelper::gotoPaymentOnCallback($this->fraud_module, $this->fraud_module_status, $this->code); + } + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['gateway_response']['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['gateway_response']['novalnet_comments'] : $form_comments['novalnet_comments']; + } + + /** + * Core Function : after_process() + * + * Send post back params(acknowledgement) to Novalnet server + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show message in front-end + * return array + */ + function get_error() { + // Get error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => $error_message + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_INVOICE_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES ('MODULE_PAYMENT_NOVALNET_INVOICE_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_ALIAS', 'NN_INV', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_INVOICE_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE','False', '6', '4', 'xtc_mod_select_option(array(\'False\' => MODULE_PAYMENT_NOVALNET_OPTION_NONE,\'CALLBACK\' => MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONCALLBACK,\'SMS\' => MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONSMS,),\'MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE\'," . MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_CALLBACK_LIMIT', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE', '', '6', '6','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_VISIBILITY_BY_AMOUNT', '', '6', '7','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_ENDCUSTOMER_INFO', '', '6', '8','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_SORT_ORDER', '0', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_ORDER_STATUS', '0', '6', '10', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_CALLBACK_ORDER_STATUS', '0', '6', '11', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_ZONE', '0', '6', '12', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_TRANS_REFERENCE1', '', '6', '13', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_TRANS_REFERENCE2', '', '6', '14', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE1','True', '6', '15', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE1\'," . MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE1 . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE2','True', '6', '16', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE2\'," . MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE2 . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE3','True', '6', '17', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE3\'," . MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE3 . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE','False', '6', '18', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE\'," . MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT', '', '6', '18','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT', '', '6', '19','', '', now()), + ('MODULE_PAYMENT_NOVALNET_INVOICE_FORCE','True', '6', '19', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_INVOICE_FORCE\'," . MODULE_PAYMENT_NOVALNET_INVOICE_FORCE . ",' , '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + * @param none + * @return boolean + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_INVOICE_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_INVOICE_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_INVOICE_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_ENABLE_FRAUDMODULE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_CALLBACK_LIMIT', + 'MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_INVOICE_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_INVOICE_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_INVOICE_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_INVOICE_CALLBACK_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE2', + 'MODULE_PAYMENT_NOVALNET_INVOICE_PAYMENT_REFERENCE3', + 'MODULE_PAYMENT_NOVALNET_INVOICE_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_INVOICE_TRANS_REFERENCE2', + 'MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE', + 'MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_INVOICE_FORCE', + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_INVOICE_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } + + /** + * To Proceed and validate Guarantee payment basic requirements in checkout + * + * @param integer $orderamount + * return string + */ + function proceedToInvoiceGuranteePayment($orderamount) { + global $order; + // Delivery address + $delivery_address = array( + 'street_address' => $order->delivery['street_address'], + 'city' => $order->delivery['city'], + 'postcode' => $order->delivery['postcode'], + 'country' => $order->delivery['country']['iso_code_2'], + ); + // Billing address + $billing_address = array( + 'street_address' => $order->billing['street_address'], + 'city' => $order->billing['city'], + 'postcode' => $order->billing['postcode'], + 'country' => $order->billing['country']['iso_code_2'], + ); + $minimum_amount_gurantee = trim(MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT) != '' ? trim(MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT) : '2000'; + $maximum_amount_gurantee = trim(MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT) != '' ? trim(MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT) : '500000'; + // Check guarantee payment + if (MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE == 'True') { + if (($orderamount >= $minimum_amount_gurantee && $orderamount <= $maximum_amount_gurantee) && in_array(strtoupper($order->billing['country']['iso_code_2']), array('DE', 'AT', 'CH')) && $order->info['currency'] == 'EUR' && $delivery_address === $billing_address) { + if (isset($_SESSION['novalnet'][$this->code]['guarantee_error'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee_error']); + } + $_SESSION['novalnet'][$this->code]['guarantee'] = TRUE; + } else if (MODULE_PAYMENT_NOVALNET_INVOICE_FORCE == 'True') { + if (isset($_SESSION['novalnet'][$this->code]['guarantee'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee']); + } + } else { + $_SESSION['novalnet'][$this->code]['guarantee'] = TRUE; + $_SESSION['novalnet'][$this->code]['guarantee_error'] = TRUE; + return MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_ERROR; + } + } else { + if(isset($_SESSION['novalnet'][$this->code]['guarantee'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee']); + } + } + } +} + diff --git a/includes/modules/payment/novalnet_paypal.php b/includes/modules/payment/novalnet_paypal.php new file mode 100644 index 0000000..e2c81e7 --- /dev/null +++ b/includes/modules/payment/novalnet_paypal.php @@ -0,0 +1,394 @@ +code = 'novalnet_paypal'; + $this->title = MODULE_PAYMENT_NOVALNET_PAYPAL_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_PAYPAL_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_PAYPAL_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_PAYPAL_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_PAYPAL_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_PAYPAL_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_PAYPAL_TEST_MODE == 'True'); // To check the test mode + // To process the paypal site + if (empty($post['novalnet_paypal_change_account'])) { + $this->form_action_url = 'https://payport.novalnet.de/paypal_payport'; + } + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { unset($_SESSION['payment']); } + return false; + } + // Unset the novalnet tid session variable + if (!empty($_SESSION['payment']) && isset($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['payment'] != $this->code) { // Unset tid + unset($_SESSION['novalnet'][$this->code]['tid']); + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_PAYPAL_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_PAYPAL_ENDCUSTOMER_INFO)) : ''; + // Get the end customer serialize details from database for one click shopping + $payment_details = NovalnetHelper::getPaymentDetails($_SESSION['customer_id'], $this->code); + $payment_details = unserialize($payment_details['payment_details']); + $this->description = MODULE_PAYMENT_NOVALNET_PAYPAL_REDIRECTION_TEXT_DESCRIPTION.'
'.MODULE_PAYMENT_NOVALNET_PAYPAL_REDIRECTION_BROWSER_TEXT_DESCRIPTION; + // To process the Normal paypal payment + if ( MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE != 'ONECLICK' || (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK' && empty($payment_details))) { // Displaying iframe form type + return $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => '
'.$this->description.'
' . $test_mode . '
' . $endcustomerinfo.'
'.NovalnetHelper::enableJavascript(), + ); + } else if (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK' && !empty($payment_details)) { + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => '
'.$this->description.'
' . $test_mode . '
' . $endcustomerinfo.'
', + ); + // Display the One click details in checkout page + $form_show = isset($_SESSION['novalnet'][$this->code]['novalnet_paypal_change_account']) ? $_SESSION['novalnet'][$this->code]['novalnet_paypal_change_account'] : 1; + $oneclick = (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK' && !empty($payment_details)) ? '' . MODULE_PAYMENT_NOVALNET_PAYPAL_NEW_ACCOUNT . '' : ''; + $selection['fields'][] = array( + 'title' => $oneclick, + 'field' => ''); + if(!empty($payment_details['paypal_transaction_tid'])) { + $selection['fields'][] = array( + 'title' =>'
'. MODULE_PAYMENT_NOVALNET_PAYPAL_TRANSACTION_TID.'
', + 'field' => '
'. $payment_details['paypal_transaction_tid'].'
' + ); + } + $selection['fields'][] = array( + 'title' => '
'. MODULE_PAYMENT_NOVALNET_PAYPAL_ORDER_TRANSACTION_TID.'
', + 'field' =>'
'. $payment_details['novalnet_transaction_tid'].' +
' + ); + $selection['fields'][] = array( + 'title' => '', + 'field' => ''.NovalnetHelper::enableJavascript() + ); + } + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + */ + function pre_confirmation_check() { + $post = $_REQUEST; + // Get the payment type + $_SESSION['novalnet'][$this->code]['novalnet_paypal_change_account'] = (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK') ? $post['novalnet_paypal_change_account'] : '0'; + // Show the javascript error message if javascript not enabled + if (!empty($post['nn_js_enabled'])) { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_NO_SCRIPT; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + // Assign the reference transaction tid in session + if (isset($post['nn_transaction_tid'])) { + $_SESSION['novalnet'][$this->code]['nn_transaction_tid'] = $post['nn_transaction_tid']; + } + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process the normal paypal payment + if (isset($_SESSION['novalnet'][$this->code]['payment_amount']) && $_SESSION['novalnet'][$this->code]['novalnet_paypal_change_account'] != '1') { // Generate the redirect payments params + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] )); + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode ); // Get the common payment params + // To process the on hold product + if($this->getOnholdValue($urlparam)) { + $urlparam['on_hold'] = 1; + } + // To send the create payment ref param to novalnet server + if(in_array( MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE, array( 'ONECLICK', 'ZEROAMOUNT'))) { + $urlparam['create_payment_ref'] = 1; + } + $vendor_details = NovalnetHelper::getVendorDetails($this->code); + // To process the zero amount booking and param send to the novalnet server + if (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ZEROAMOUNT') { + if(!in_array($vendor_details['tariff_type'], array( 1, 3, 4 ))) { + unset($vendor_details['tariff_type'],$urlparam['on_hold']); + $urlparam['amount'] = 0; + $_SESSION['novalnet'][$this->code]['serialize_data'] = serialize($urlparam); + $_SESSION['novalnet'][$this->code]['reference_transaction'] = 1; + } else { + unset($urlparam['create_payment_ref']); + } + } + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else if (!isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { + // Redirect to checkout page for invaild amount + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + * + * Send params to Novalnet server + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + if(MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK') { + // Store the response value in database for one click shopping type + $_SESSION['novalnet'][$this->code]['serialize_data'] = serialize(array( + 'paypal_transaction_tid' => $post['paypal_transaction_id'], + 'novalnet_transaction_tid' => $post['tid'], + )); + } + // To validate the response + $form_comments = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } else if (MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE == 'ONECLICK' && $_SESSION['novalnet'][$this->code]['novalnet_paypal_change_account'] == '1' && !empty($_SESSION['novalnet'][$this->code]['nn_transaction_tid'])) { // To process the one click shopping + $param_inputs = array_merge((array) $order, $_SESSION['novalnet'][$this->code]); + $urlparam = NovalnetHelper::getCommonParms($param_inputs); // Get the novalnet common payment params + // To process the on hold product + if($this->getOnholdValue($urlparam)) { + $urlparam['on_hold'] = 1; + } + $urlparam['payment_ref'] = $_SESSION['novalnet'][$this->code]['nn_transaction_tid']; + $_SESSION['novalnet'][$this->code]['reference_transaction'] = 1; + // payment call send to novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparam); + parse_str($response, $payment_response); + if ($payment_response['status'] == '100') { //Payment success + NovalnetHelper::getPostValues($this->code, $urlparam, $payment_response); + } else { // Payment failed + unset($_SESSION['novalnet'][$this->code]['reference_transaction']); + $stauts_failed = NovalnetHelper::getServerResponse($payment_response); + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . utf8_decode($stauts_failed); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + } + + /** + * Core Function : after_process() + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( 'payment_type' => $this->code, 'order_no' => $insert_id )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => utf8_encode($error_message) + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_PAYPAL_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_PAYPAL_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_ALIAS', 'NN_PP', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PAYPAL_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_PAYPAL_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PAYPAL_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_PAYPAL_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE','False', '6', '8', 'xtc_mod_select_option(array(\'False\' => MODULE_PAYMENT_NOVALNET_OPTION_NONE,\'ONECLICK\' => MODULE_PAYMENT_NOVALNET_PAYPAL_ONE_CLICK,\'ZEROAMOUNT\' => MODULE_PAYMENT_NOVALNET_PAYPAL_ZERO_AMOUNT,),\'MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE\'," . MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_PENDING_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_ORDER_STATUS', '0', '6', '8', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE', '0', '6', '9', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1', '', '6', '10', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2', '', '6', '11', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_PAYPAL_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + */ + function keys() { + global $gx_version; // Get teh gambio version + echo ''; + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_PAYPAL_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_PAYPAL_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_SHOP_TYPE', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_PENDING_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_PAYPAL_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } + + /** + * To get On hold value + * + * return boolean + */ + function getOnholdValue($urlparam) { + if (trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT) > 0 && $urlparam['amount'] >= trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT)) { // If condition true then order proceed on-hold transaction + return true; + } + } +} + diff --git a/includes/modules/payment/novalnet_prepayment.php b/includes/modules/payment/novalnet_prepayment.php new file mode 100644 index 0000000..c22f534 --- /dev/null +++ b/includes/modules/payment/novalnet_prepayment.php @@ -0,0 +1,276 @@ +code = 'novalnet_prepayment'; + $this->title = MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_PREPAYMENT_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_PREPAYMENT_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_PREPAYMENT_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_PREPAYMENT_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEST_MODE == 'True'); // To check the test mode + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { unset($_SESSION['payment']); } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_INV_PRE_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : confirmation() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : process_button() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // Assign order amount in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + $post = $_REQUEST; + // Assign shop details in session + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { + $_SESSION['novalnet'][$this->code] = array_merge($post, array( 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] )); + } else { + // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function before_process() { + global $order; + // Get the novalnet common payment params + $urlparam = NovalnetHelper::getCommonParms(array_merge((array) $order, array( 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] )), $this->test_mode); + $urlparam['invoice_type'] = 'PREPAYMENT'; + // payment call send to novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparam, true); + parse_str($response, $data); + // Form the novalnet transaction comments and transaction details are stored in session variable + $form_comments = NovalnetHelper::checkPaymentStatus($this->code, $data,$urlparam); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } + + /** + * Core Function : after_process() + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( 'payment_type' => $this->code, 'order_no' => $insert_id )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => $error_message + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALIAS', 'NN_PREPAY', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_CALLBACK_ORDER_STATUS', '0', '6', '8', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_ZONE', '0', '6', '9', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_TRANS_REFERENCE1', '', '6', '10', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_TRANS_REFERENCE2', '', '6', '11', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE1','True', '6', '12', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE1\'," . MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE1 . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE2','True', '6', '13', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE2\'," . MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE2 . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE3','True', '6', '14', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE3\'," . MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE3 . ",' , '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + */ + function keys() { + global $gx_version; // Get the gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_CALLBACK_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE2', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_PAYMENT_REFERENCE3', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_TRANS_REFERENCE2', + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_PREPAYMENT_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_przelewy24.php b/includes/modules/payment/novalnet_przelewy24.php new file mode 100644 index 0000000..08460f5 --- /dev/null +++ b/includes/modules/payment/novalnet_przelewy24.php @@ -0,0 +1,286 @@ +code = 'novalnet_przelewy24'; + $this->title = MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_PRZELEWY24_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE == 'True'); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE == 'True'); // To check test mode in shop + $this->form_action_url = 'https://payport.novalnet.de/globalbank_transfer'; + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status() + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection() + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO)) : ''; + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_REDIRECT_DESC . '
' . $test_mode . '
' . $endcustomerinfo); + return $selection; + } + + /** + * Core Function : pre_confirmation_check() + * + * Perform validations for post values + * @return boolean + */ + function pre_confirmation_check() { + return false; + } + + /** + * Core Function : confirmation() + * + * Displays confirmation page + * @return boolean + */ + function confirmation() { + // order amount stored in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = NovalnetHelper::getPaymentAmount(); + } + + /** + * Core Function : process_button() + * + * Payments redirects from shop to payment site + */ + function process_button() { + global $order; + // To process and generate the redirect params + if (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { + $_SESSION['novalnet'][$this->code]['order_obj'] = array_merge((array) $order, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + // Get the common payment params + $urlparam = NovalnetHelper::getCommonParms($_SESSION['novalnet'][$this->code]['order_obj'], $this->test_mode); + // To encode the vendor configuration and get the hash value + NovalnetHelper::generateHashValue($urlparam, array('auth_code', 'product', 'tariff', 'amount', 'test_mode', 'uniqid')); + $urlparam['implementation'] = 'PHP'; + $urlparam['return_method'] = $urlparam['error_return_method'] = 'POST'; + $urlparam['return_url'] = $urlparam['error_return_url'] = xtc_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $urlparam['user_variable_0'] = (ENABLE_SSL == true) ? HTTPS_SERVER : HTTP_SERVER . DIR_WS_CATALOG; + // Assign novalnet payment params in the hidden fields + foreach ($urlparam as $k => $v) { + $process_button_string .= xtc_draw_hidden_field($k, $v); + } + return $process_button_string; + } else { // payment redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process() + */ + function before_process() { + global $order; + $post = $_REQUEST; + // To process the response validation and to update the transaction details in shop + if (isset($post['tid'])) { + // To validate the response + $form_comments = NovalnetHelper::validateRedirectResponse($this->code, $post); + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['novalnet_comments'] : $form_comments['novalnet_comments']; + } + } + + /** + * Core Function : after_process() + * + * Send post back params(acknowledgement) to Novalnet server + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error() + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get the error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // Show the Error message in front end + return array( + 'title' => $this->code, + 'error' => $error_message + ); + } + + /** + * Core Function : javascript_validation() + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check() + * + * Checks for payment installation status + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install() + * + * Payment module installation + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALIAS', 'NN_PRZ', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT', '', '6', '4','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER', '0', '6', '6', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS', '0', '6', '7', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE', '0', '6', '8', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1', '', '6', '9', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2', '', '6', '10', '', '', now())"); + } + + /** + * Core Function : remove() + * + * Payment module uninstallation + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALIAS'))) . "')"); + } + + /** + * Core Function : keys() + * + * Return keys to display in payment configuration (Backend) + */ + function keys() { + global $gx_version; // Get the gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2' + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } +} + diff --git a/includes/modules/payment/novalnet_sepa.php b/includes/modules/payment/novalnet_sepa.php new file mode 100644 index 0000000..ebc8b79 --- /dev/null +++ b/includes/modules/payment/novalnet_sepa.php @@ -0,0 +1,631 @@ +code = 'novalnet_sepa'; + $this->title = 'Novalnet ' . MODULE_PAYMENT_NOVALNET_SEPA_TEXT_TITLE; + $this->public_title = MODULE_PAYMENT_NOVALNET_SEPA_PUBLIC_TITLE; + $this->sort_order = 0; + if (strpos(MODULE_PAYMENT_INSTALLED, $this->code) !== false) { + $this->sort_order = defined('MODULE_PAYMENT_NOVALNET_SEPA_SORT_ORDER') && MODULE_PAYMENT_NOVALNET_SEPA_SORT_ORDER != '' ? MODULE_PAYMENT_NOVALNET_SEPA_SORT_ORDER : 0; + $this->enabled = (MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_MODULE == 'True'); + $this->fraud_module = ((MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE == 'False') ? false : MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE); + $this->test_mode = (MODULE_PAYMENT_NOVALNET_SEPA_TEST_MODE == 'True');// To check the test mode + NovalnetHelper::getLastSuccessPayment($this->code); // By default last transaction payment select in checkout page + } + if (is_object($order)) + $this->update_status(); + } + + /** + * Core Function : update_status () + * + * check if zone is allowed to see module + */ + function update_status() { + global $order; + if ($_SESSION['shipping']['id'] == 'selfpickup_selfpickup') { + $this->enabled = false; + } + if (($this->enabled == true) && ((int) MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_ZONE > 0)) { + $check_flag = false; + $check_query = xtc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); + while ($check = xtc_db_fetch_array($check_query)) { + if ($check['zone_id'] < 1) { + $check_flag = true; + break; + } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + $check_flag = true; + break; + } + } + if ($check_flag == false) { + $this->enabled = false; + } + } + } + + /** + * Core Function : selection () + * + * Display checkout form in chekout payment page + * @return array + */ + function selection() { + global $order; + if(!empty($order)) { + // Get order amount + $order_amount = NovalnetHelper::getPaymentAmount(); + // Get order amount set for fraud module validation + if(empty($_SESSION['novalnet']['novalnet_sepa']['nn_order_amount'])) { + $_SESSION['novalnet']['novalnet_sepa']['nn_order_amount'] = $order_amount; + } + // Payment hide in checkout page when condition was true + if (NovalnetHelper::merchantValidate($this->code) || strpos(MODULE_PAYMENT_INSTALLED, 'novalnet_config') === false || !NovalnetHelper::hidePaymentVisibility($this->code, $order_amount)) { + if (!empty($_SESSION['payment']) && $_SESSION['payment'] == $this->code) { + unset($_SESSION['payment']); + } + return false; + } + // Payment hide in checkout page when condition was true if fraud module enable + if (!empty($_SESSION[$this->code . '_payment_lock_nn']) && isset($_SESSION[$this->code . '_callback_max_time_nn']) && $_SESSION[$this->code . '_callback_max_time_nn'] > time()) { + return false; + } + // Unset the novalnet session variable + if (isset($_SESSION['payment']) && $_SESSION['payment'] != $this->code && isset($_SESSION['novalnet'][$this->code])) { + unset($_SESSION['novalnet'][$this->code]); + } + // Unset the novalnet tid session variable + if ((!empty($_SESSION['payment']) && $_SESSION['novalnet'][$this->code]['tid'] != '' && $_SESSION['payment'] != $this->code)) { + unset($_SESSION['novalnet'][$this->code]['tid']); + } + // Unset the fraud module session variable + if ($_SESSION['novalnet'][$this->code]['tid'] != '' && !empty($_SESSION[$this->code . '_payment_lock_nn']) && isset($_SESSION[$this->code . '_callback_max_time_nn']) && $_SESSION[$this->code . '_callback_max_time_nn'] < time()) { + unset($_SESSION[$this->code . '_callback_max_time_nn'], $_SESSION[$this->code . '_payment_lock_nn'], $_SESSION['novalnet'][$this->code]['tid']); + } + // Get order amount set for fraud module validation + if(empty($_SESSION['novalnet']['novalnet_sepa']['nn_set_order_amount']) || (empty($_REQUEST['payment']) && !empty($_SESSION['novalnet']['novalnet_sepa']['nn_set_order_amount']) && $order_amount != $_SESSION['novalnet']['novalnet_sepa']['nn_order_amount'])) { + $_SESSION['novalnet']['novalnet_sepa']['nn_set_order_amount'] = true; + $_SESSION['novalnet']['novalnet_sepa']['nn_order_amount'] = $order_amount; + } + $gurantee_error = $this->proceedToGuranteePayment($order_amount); + //To check the basic fraud module requirements + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_sepa']['nn_order_amount']); + // To check the test mode in shop + $test_mode = $this->test_mode == 1 ? MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG : ''; + // Merchant can show the information for end customer in checkout page + $endcustomerinfo = trim(strip_tags(MODULE_PAYMENT_NOVALNET_SEPA_ENDCUSTOMER_INFO)) != '' ? trim(strip_tags(MODULE_PAYMENT_NOVALNET_SEPA_ENDCUSTOMER_INFO)) : ''; + $customer_name = (!empty($order->customer['firstname']) ? $order->customer['firstname'] : '') . ' ' . (!empty($order->customer['lastname']) ? $order->customer['lastname'] : ''); + $selection = array( + 'id' => $this->code, + 'module' => $this->public_title, + 'description' => MODULE_PAYMENT_NOVALNET_SEPA_DESC . '
' . $test_mode . '
' . $endcustomerinfo.'
'.$gurantee_error.''); + // Fraud module pin box showing in checkout page if fraud module enable + if ($_SESSION['novalnet'][$this->code]['tid'] != '' && in_array($this->fraud_module,array('CALLBACK', 'SMS')) && $this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_REQUEST_DESC, + 'field' => '
'.xtc_draw_input_field($this->code . '_fraud_pin', '', 'id="' . $this->code . '_' . strtolower($this->fraud_module) . 'pin"AUTOCOMPLETE="off"').'
' + ); + $selection['fields'][] = array( + 'title' => '', + 'field' => xtc_draw_checkbox_field($this->code . '_new_pin', '1', false, 'id="' . $this->code . '_' . strtolower($this->fraud_module) . 'new_pin"') . MODULE_PAYMENT_NOVALNET_FRAUDMODULE_NEW_PIN, + ); + } else { + // To show the sepa form fields + $data = NovalnetHelper::getVendorDetails($this->code); + NovalnetHelper::getAffDetails($data); // Appending affiliate parameters + // Get the end customer serialize details from database for one click shopping + $sqlQuerySet = NovalnetHelper::getPaymentDetails($_SESSION['customer_id'], $this->code); + $payment_details = unserialize($sqlQuerySet['payment_details']); + $form_show = !empty($_SESSION['novalnet'][$this->code]['novalnet_sepachange_account']) ? '1' : '0'; + $sepa_fields = xtc_draw_hidden_field('', $data['vendor'], 'id="nn_vendor"'). + xtc_draw_hidden_field('', $data['auth_code'], 'id="nn_auth_code"'). + xtc_draw_hidden_field('nn_sepa_hash','', 'id="nn_sepa_hash"'). + xtc_draw_hidden_field('', NovalnetHelper::getSepaRefillHash($this->code), 'id="nn_sepa_input_panhash"'). + xtc_draw_hidden_field('', '', 'id="nn_sepa_iban"'). + xtc_draw_hidden_field('', '', 'id="nn_sepa_bic"'). + xtc_draw_hidden_field('novalnet_sepachange_account', $form_show, 'id="novalnet_sepachange_account"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_SEPA_SELECT_COUNTRY, 'id="nn_sepa_country"'). + xtc_draw_hidden_field('nn_sepa_uniqueid', NovalnetHelper::uniqueRandomString(), 'id="nn_sepa_uniqueid"'). + xtc_draw_hidden_field('', DIR_WS_CATALOG, 'id="nn_root_sepa_catalog"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_SEPA_MANDATE_CONFIRM_ERROR, 'id="nn_lang_mandate_confirm"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_VALID_MERCHANT_CREDENTIALS_ERROR, 'id="nn_lang_valid_merchant_credentials"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR, 'id="nn_lang_valid_account_details"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR, 'id="nn_lang_valid_account_details"'). + xtc_draw_hidden_field('', MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE, 'id="nn_sepa_shopping_type"').''; + $oneclick = (MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ONECLICK' && !empty($payment_details)) ? '' . MODULE_PAYMENT_NOVALNET_SEPA_NEW_ACCOUNT . '' : ''; + // To show the one click shop fields + if(MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ONECLICK') { + $selection['fields'][] = array('title' =>$oneclick, + 'field' => ''); + $selection['fields'][] = array( + 'title' => '', + 'field' => '' + ); + $selection['fields'][] = array( + 'title' => '', + 'field' => '' + ); + if($payment_details['bic'] != '123456' ) { + $selection['fields'][] = array( + 'title' => '', + 'field' => '' + ); + } + } + // To show the Normal sepa form fields + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_ACCOUNT_HOLDER, + 'field' => '
' . xtc_draw_input_field($this->code . '_account_holder', $customer_name, 'id="' . $this->code . '_account_holder" class="novalnet_sepa_account_holder" AUTOCOMPLETE="off" placeholder="testere" onkeypress="return account_holder_validate(event, true);"') . '
' + ); + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_BANK_COUNTRY, + 'field' => '
' . xtc_draw_pull_down_menu($this->code . '_bank_country', NovalnetHelper::sepaBankCountry(), $order->billing['country']['iso_code_2'], 'id="' . $this->code . '_bank_country"') . '
' + ); + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_ACCOUNT_OR_IBAN, + 'field' => '
' . xtc_draw_input_field($this->code . '_iban', '', 'id="' . $this->code . '_iban" AUTOCOMPLETE="off" onkeypress="return ibanbic_validate(event, false);"') . '' . '
' + ); + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_BANKCODE_OR_BIC, + 'field' => '
' . xtc_draw_input_field($this->code . '_bic', '', 'id="' . $this->code . '_bic" AUTOCOMPLETE="off" onkeypress="return ibanbic_validate(event, false);"') . '' . '
' + ); + // To show the fraud module fields + if ($_SESSION['novalnet'][$this->code]['tid'] == '' && in_array($this->fraud_module,array('CALLBACK', 'SMS')) && $this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + if ($this->fraud_module == 'CALLBACK') { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_CALLBACK_INPUT_TITLE, + 'field' => '
' . xtc_draw_input_field($this->code . '_fraud_tel', $order->customer['telephone'], 'id="' . $this->code . '_' .strtolower($this->fraud_module).'" AUTOCOMPLETE=off'). '
' + ); + } else { + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_INPUT_TITLE, + 'field' => "
".xtc_draw_input_field($this->code . "_fraud_mobile", '', "id=" . $this->code . "_" .strtolower($this->fraud_module)."pin"." AUTOCOMPLETE=off")."
" + ); + } + } + // To show the gurantee payment field + if (!empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $customer_id = (isset($_SESSION['customer_id'])) ? 'customers_id= "' . xtc_db_input($_SESSION['customer_id']) . '"' : 'customers_email_address= "' . xtc_db_input($order->customer['email_address']) . '"'; + $customer_dbvalue = xtc_db_fetch_array(xtc_db_query("SELECT customers_dob FROM " . TABLE_CUSTOMERS . " WHERE " . $customer_id . " ORDER BY customers_id DESC")); + $customer_dbvalue['customers_dob'] = !in_array($customer_dbvalue['customers_dob'] ,array('0000-00-00 00:00:00','1000-01-01 00:00:00')) ? date('Y-m-d', strtotime($customer_dbvalue['customers_dob'])) :''; + $selection['fields'][] = array( + 'title' => MODULE_PAYMENT_GUARANTEE_FIELD, + 'field' => '
'.xtc_draw_input_field($this->code . '_dob', $customer_dbvalue['customers_dob'], 'id="' . $this->code . '_dob" AUTOCOMPLETE=off').'
' + ); + } + $selection['fields'][] = array( + 'title' => '
', + 'field' => "
" . xtc_draw_checkbox_field($this->code . '_mandate_confirm', 1, false, 'id="' . $this->code . '_mandate_confirm"') . '' . MODULE_PAYMENT_NOVALNET_SEPA_FORM_MANDATE_CONFIRM_TEXT . '
' . $sepa_fields.NovalnetHelper::enableJavascript() + ); + } + return $selection; + } + } + + /** + * Core Function : pre_confirmation_check () + * + * Perform validations for post values + */ + function pre_confirmation_check() { + global $order; + $post = $_REQUEST; + $_SESSION['novalnet'][$this->code . '_newpin'] = $post[$this->code . '_new_pin']; + $_SESSION['novalnet'][$this->code]['hash'] = $post['nn_sepa_hash']; + $_SESSION['novalnet'][$this->code]['novalnet_sepachange_account'] = !empty($post['novalnet_sepachange_account']) ? $post['novalnet_sepachange_account'] : '0'; + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_sepa']['nn_order_amount']); + // if javascript not enable in system then show the error message + if (!empty($post['nn_js_enabled'])) { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_NO_SCRIPT; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + //To validate the fraud module pin field + if ($this->fraud_module_status && !empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1 && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + NovalnetHelper::validateUserInputsOnCallback($this->code, $post, $this->fraud_module); + } else if (empty($_SESSION['novalnet'][$this->code]['tid'])) { // To performing the first call process + //To validate the sepa form and hash value + if (MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE != 'ONECLICK' && ((!isset($post['novalnet_sepa_account_holder']) || trim($post['novalnet_sepa_account_holder']) == '') || (!isset($post['nn_sepa_hash']) || $post['nn_sepa_hash'] == '') || (!isset($post['nn_sepa_uniqueid']) || $post['nn_sepa_uniqueid'] == ''))) { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' .MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + // To validate the fraud module tel/sms fields + if ($this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $error_message = NovalnetHelper::validateCallbackFields($post, $this->fraud_module, $this->code); + if ($error_message != '') { + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . trim($error_message); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + $error_message= ''; + //To validate the gurantee payment field + if (!empty($_SESSION['novalnet'][$this->code]['guarantee']) && !empty($_SESSION['novalnet'][$this->code]['guarantee_error'])) { + $error_message = MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_ERROR; + } elseif (!empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + $current_age = date('Y-m-d',strtotime($post['novalnet_sepa_dob'])); + if ($post['novalnet_sepa_dob'] == '') { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_EMPTY_ERROR_MESSAGE; + } else if(!preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",trim($post['novalnet_sepa_dob']))) { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_INVAILD_DOB_ERROR_MESSAGE; + } else if (trim($post['novalnet_sepa_dob']) != '' ) { + if(time() < strtotime('+18 years', strtotime($current_age)) && MODULE_PAYMENT_NOVALNET_SEPA_FORCE == 'False') { + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_AGE_ERROR_MESSAGE; + } else if (!NovalnetHelper::validateDuedate(trim($post['novalnet_sepa_dob']))) { // Validate dob field + $error_message = MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_ERROR_MESSAGE; + } + } + } + if($error_message != '' && MODULE_PAYMENT_NOVALNET_SEPA_FORCE == 'False'){ + unset($_SESSION['payment'],$_SESSION['novalnet'][$this->code]['guarantee']); + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error_message=' . $error_message, 'SSL', true, false)); + } + } + // To set the session variable for one click shopping process + if (isset($post['nn_payment_ref_tid_sepa']) && $post['novalnet_sepachange_account'] == 0) { + $_SESSION['novalnet'][$this->code]['nn_payment_ref_enable'] = true; + $_SESSION['novalnet'][$this->code]['nn_payment_ref_tid_sepa'] = $post['nn_payment_ref_tid_sepa']; + return true; + } + } + + /** + * Core Function : confirmation () + * + * Displays confirmation page + */ + function confirmation() { + global $order; + $order_amount = NovalnetHelper::getPaymentAmount(); + // order amount stored in session + $_SESSION['novalnet'][$this->code]['payment_amount'] = $order_amount ; + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_sepa']['nn_order_amount']); + // Validate fraud module process + if ($this->fraud_module_status && !empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1 && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { + NovalnetHelper::validateAmountOnCallback($this->code, $this->fraud_module); + } + + } + + /** + * Core Function : process_button () + * + * Payments redirects from shop to payment site (Note : if the payment is redirect) + */ + function process_button() { + $post = $_REQUEST; + // To generate the new pin for fraud module + if (isset($post[$this->code . '_new_pin']) && $post[$this->code . '_new_pin'] == 1) { // Generate the new pin for fraud module + $new_pin_response = NovalnetHelper::doCallbackRequest('TRANSMIT_PIN_AGAIN', $this->code); + $response = simplexml_load_string($new_pin_response); + $response = json_decode(json_encode($response), true); + $response_text = isset($response['status_message']) ? $response['status_message'] : (isset($response['pin_status']['status_message']) ? $response['pin_status']['status_message'] : $response['status_text']); + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . $response_text; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } elseif (isset($_SESSION['novalnet'][$this->code]['payment_amount'])) { // Store the values in session + $novalnet_order_details = isset($_SESSION['novalnet'][$this->code]) ? $_SESSION['novalnet'][$this->code] : array(); + $_SESSION['novalnet'][$this->code] = array_merge($novalnet_order_details, $post, array( + 'payment_amount' => $_SESSION['novalnet'][$this->code]['payment_amount'] + )); + } else { // Payments redirect to checkout page if amount invaild + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } + + /** + * Core Function : before_process () + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function before_process() { + global $order; + $order_amount = NovalnetHelper::getPaymentAmount(); + $this->fraud_module_status = NovalnetHelper::setFraudModuleStatus($this->code, $this->fraud_module,$_SESSION['novalnet']['novalnet_sepa']['nn_order_amount']); + $param_inputs = array_merge((array) $order, $_SESSION['novalnet'][$this->code], array( + 'fraud_module' => $this->fraud_module, + 'fraud_module_status' => $this->fraud_module_status + )); + // Fraud module call request send to the novalnet server + if (!empty($_SESSION['novalnet'][$this->code]['tid']) && $_SESSION['novalnet'][$this->code . '_newpin'] != 1) { + $callback_response = NovalnetHelper::doCallbackRequest('PIN_STATUS', $this->code); + $callback_response = simplexml_load_string($callback_response); + $callback_response = json_decode(json_encode($callback_response), true); + $_SESSION['novalnet'][$this->code]['gateway_response']['tid_status'] = $callback_response['tid_status']; + $callback_response_text = isset($callback_response['status_message']) ? $callback_response['status_message'] : (isset($callback_response['pin_status']['status_message']) ? $callback_response['pin_status']['status_message'] : $callback_response['status_text']); + if ($callback_response['status'] != 100) { + if ($callback_response['status'] == '0529006') { + $_SESSION[$this->code . '_payment_lock_nn'] = true; + $_SESSION[$this->code . '_callback_max_time_nn'] = time() + (30 * 60); + } + $payment_error_return = 'payment_error=' . $this->code . '&error_message=' . $callback_response_text; + xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); + } + } else { + // Normal payment request send to the novalnet server + $urlparam = NovalnetHelper::getCommonParms($param_inputs); // Perform real time payment transaction + // Get the vendor configuration details + $vendor_details = NovalnetHelper::getVendorDetails($this->code); + // To process on hold product + if (trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT) > 0 && $order_amount >= trim(MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT)) { // If condition true then order proceed on-hold transaction + $urlparam['on_hold'] = 1; + } + // To send the create payment ref param to novalnet server + if(in_array( MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE, array( 'ONECLICK', 'ZEROAMOUNT'))) { + $urlparam['create_payment_ref'] = 1; + } + // To process the zero amount booking and param send to the novalnet server + if ((MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ZEROAMOUNT') && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { // To process zero amount order booking + if(!in_array($vendor_details['tariff_type'], array( 1, 3, 4 ))) { + unset($urlparam['on_hold'],$vendor_details['tariff_type']); + $urlparam['amount'] = 0; + $_SESSION['novalnet'][$this->code]['serialize_data'] = serialize($urlparam); + $_SESSION['novalnet'][$this->code]['reference_transaction'] = 1; + }else { + unset($urlparam['create_payment_ref']); + } + } + $sepa_duedate = ((trim(MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE) >= 7) ? trim(MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE) : 7); + $urlparam['sepa_due_date'] = (date('Y-m-d', strtotime('+' . $sepa_duedate . ' days'))); + //The gurantee payment param send to the novalnet server + if (!empty($_SESSION['novalnet'][$this->code]['guarantee']) && !empty($_SESSION['novalnet'][$this->code]['novalnet_sepa_dob']) && (time() > strtotime('+18 years', strtotime(date('Y-m-d',strtotime($_SESSION['novalnet'][$this->code]['novalnet_sepa_dob'])))) && NovalnetHelper::validateDuedate(trim($_SESSION['novalnet'][$this->code]['novalnet_sepa_dob'])))) { // To process guarantee payments + if (MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ZEROAMOUNT') { + unset($urlparam['create_payment_ref']); + } + $urlparam['key'] = 40; + $urlparam['birth_date'] = (date('Y-m-d', strtotime($_SESSION['novalnet'][$this->code]['novalnet_sepa_dob']))); + $urlparam['payment_type'] = 'GUARANTEED_DIRECT_DEBIT_SEPA'; + } + $fraud_module_active = false; + //Fraud module param send to the novalnet server + if ($this->fraud_module_status && empty($_SESSION['novalnet'][$this->code]['guarantee'])) { // Allow fraud module param if enabled + $fraud_module_active = true; + if ($this->fraud_module == 'CALLBACK') { // if fraud module pin by callback enabled + $urlparam['tel'] = trim($_SESSION['novalnet'][$this->code]['novalnet_sepa_fraud_tel']); + $urlparam['pin_by_callback'] = '1'; + } else { // if fraud module pin by sms enabled + $urlparam['mobile'] = trim($_SESSION['novalnet'][$this->code]['novalnet_sepa_fraud_mobile']); + $urlparam['pin_by_sms'] = '1'; + } + } + if (!empty($_SESSION['novalnet'][$this->code]['nn_payment_ref_tid_sepa']) && $_SESSION['novalnet'][$this->code]['novalnet_sepachange_account'] == '0' && MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ONECLICK' ) { // To process payment ref + $urlparam['payment_ref'] = $_SESSION['novalnet'][$this->code]['nn_payment_ref_tid_sepa']; + $_SESSION['novalnet'][$this->code]['reference_transaction'] = 1; + unset($_SESSION['novalnet'][$this->code]['nn_payment_ref_tid_sepa'],$urlparam['pin_by_callback'],$urlparam['pin_by_sms'],$fraud_module_active,$urlparam['create_payment_ref']); + } else { + $urlparam['iban_bic_confirmed'] = 1; + $urlparam['bank_account_holder'] = $_SESSION['novalnet'][$this->code]['novalnet_sepa_account_holder']; + $urlparam['sepa_hash'] = $_SESSION['novalnet'][$this->code]['hash']; + $urlparam['sepa_unique_id'] = $_SESSION['novalnet'][$this->code]['nn_sepa_uniqueid']; + } + // Payment call request send to the novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $urlparam); + parse_str($response, $data); + // sepa form value set in session variable + if(MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE == 'ONECLICK' && $urlparam['create_payment_ref'] == '1' && !isset($urlparam['payment_ref'])) { + $_SESSION['novalnet'][$this->code]['serialize_data'] = serialize(array( + 'bankaccount_holder' => $data['bankaccount_holder'], + 'iban' => $data['iban'], + 'bic' => $data['bic'], + 'tid' => $data['tid'] + )); + } + // Form the novalnet transaction comments and transaction details are stored in session variable + $form_comments = NovalnetHelper::checkPaymentStatus($this->code, $data,$urlparam); + // To process the fraud module on first call + if ($fraud_module_active) { + NovalnetHelper::gotoPaymentOnCallback($this->fraud_module, $this->fraud_module_status, $this->code); + } + } + // Novalnet transaction details update the orders + $order->info['comments'] = !empty($_SESSION['novalnet'][$this->code]['gateway_response']['novalnet_comments']) ? $_SESSION['novalnet'][$this->code]['gateway_response']['novalnet_comments'] : $form_comments['novalnet_comments']; + } + + /** + * Core Function : after_process () + * + * Send params to Novalnet server (Note : if the payment uses curl request) + */ + function after_process() { + global $insert_id; + // Update the order status in shop + NovalnetHelper::updateOrderStatus($insert_id, $this->code); + // Perform paygate second call for transaction confirmations / order_no update + NovalnetHelper::doSecondCallProcess(array( + 'payment_type' => $this->code, + 'order_no' => $insert_id + )); + } + + /** + * Core Function : get_error () + * + * Show validation / error message + * @return array + */ + function get_error() { + // Get error message from shop + $error_message = (isset($_GET['payment_message']) ? $_GET['payment_message'] : $_GET['error_message']); + // return the Error message in front end + return array( + 'title' => $this->code, + 'error' => $error_message + ); + } + + /** + * Core Function : javascript_validation () + * + * Javascript validation takes place + * @return boolean + */ + function javascript_validation() { + return false; + } + + /** + * Core Function : check () + * + * Checks for payment installation status + */ + function check() { + if (!isset($this->_check)) { + $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOVALNET_SEPA_ALLOWED'"); + $this->_check = xtc_db_num_rows($check_query); + } + return $this->_check; + } + + /** + * Core Function : install () + * + * Payment module installation + */ + function install() { + xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " + (configuration_key, configuration_value, configuration_group_id, sort_order,set_function, use_function, date_added) + VALUES + ('MODULE_PAYMENT_NOVALNET_SEPA_ALLOWED', '', '6', '1', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_ALIAS', 'NN_SEPA', '6', '0', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_MODULE','False', '6', '2', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_MODULE\'," . MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_MODULE . ",' , '',now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_TEST_MODE','False', '6', '3', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_TEST_MODE\'," . MODULE_PAYMENT_NOVALNET_SEPA_TEST_MODE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE','False', '6', '4', 'xtc_mod_select_option(array(\'False\' => MODULE_PAYMENT_NOVALNET_OPTION_NONE,\'CALLBACK\' => MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONCALLBACK,\'SMS\' => MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONSMS,),\'MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE\'," . MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_CALLBACK_LIMIT', '', '6', '5','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE', '', '6', '6','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL','False', '6', '7', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL\'," . MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_REFILL','False', '6', '8', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_REFILL\'," . MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_REFILL . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE','False', '6', '9', 'xtc_mod_select_option(array(\'False\' => MODULE_PAYMENT_NOVALNET_OPTION_NONE,\'ONECLICK\' => MODULE_PAYMENT_NOVALNET_SEPA_ONE_CLICK,\'ZEROAMOUNT\' => MODULE_PAYMENT_NOVALNET_SEPA_ZERO_AMOUNT,),\'MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE\'," . MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE . ",' ,'',now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_VISIBILITY_BY_AMOUNT', '', '6', '10','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_ENDCUSTOMER_INFO', '', '6', '11','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_SORT_ORDER', '0', '6', '12', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_ORDER_STATUS', '0', '6', '13', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_ZONE', '0', '6', '14', 'xtc_cfg_pull_down_zone_classes(', 'xtc_get_zone_class_title',now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_TRANS_REFERENCE1', '', '6', '15', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_TRANS_REFERENCE2', '', '6', '16', '', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE','False', '6', '17', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE\'," . MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE . ",' , '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT', '', '6', '18','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT', '', '6', '19','', '', now()), + ('MODULE_PAYMENT_NOVALNET_SEPA_FORCE','True', '6', '20', 'xtc_mod_select_option(array(\'True\' => MODULE_PAYMENT_NOVALNET_TRUE,\'False\' => MODULE_PAYMENT_NOVALNET_FALSE),\'MODULE_PAYMENT_NOVALNET_SEPA_FORCE\'," . MODULE_PAYMENT_NOVALNET_SEPA_FORCE . ",' , '', now())"); + } + + /** + * Core Function : remove () + * + * Payment module uninstallation + */ + function remove() { + xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", array_merge($this->keys(),array('MODULE_PAYMENT_NOVALNET_SEPA_ALIAS'))) . "')"); + } + + /** + * Core Function : keys () + * + * Return keys to display in payment configuration (Backend) + */ + function keys() { + global $gx_version; // Get teh gambio version + $alias_menu = array(); + if($gx_version >= '3.1.1.0' ) { + $alias_menu = array_merge($alias_menu,array('MODULE_PAYMENT_NOVALNET_SEPA_ALIAS')); + } + $return_key = array_merge(array( + 'MODULE_PAYMENT_NOVALNET_SEPA_ALLOWED', + 'MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_MODULE', + 'MODULE_PAYMENT_NOVALNET_SEPA_TEST_MODE', + 'MODULE_PAYMENT_NOVALNET_SEPA_ENABLE_FRAUDMODULE', + 'MODULE_PAYMENT_NOVALNET_SEPA_CALLBACK_LIMIT', + 'MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE', + 'MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL', + 'MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_REFILL', + 'MODULE_PAYMENT_NOVALNET_SEPA_SHOP_TYPE', + 'MODULE_PAYMENT_NOVALNET_SEPA_VISIBILITY_BY_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_SEPA_ENDCUSTOMER_INFO', + 'MODULE_PAYMENT_NOVALNET_SEPA_SORT_ORDER', + 'MODULE_PAYMENT_NOVALNET_SEPA_ORDER_STATUS', + 'MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_ZONE', + 'MODULE_PAYMENT_NOVALNET_SEPA_TRANS_REFERENCE1', + 'MODULE_PAYMENT_NOVALNET_SEPA_TRANS_REFERENCE2', + 'MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE', + 'MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT', + 'MODULE_PAYMENT_NOVALNET_SEPA_FORCE', + ),$alias_menu); + foreach ($return_key as $key => $value) { + if( ($gx_version >= '3.1.1.0' && $value == 'MODULE_PAYMENT_NOVALNET_SEPA_ALIAS')) { + unset($return_key[$key]); + break; + } + } + return $return_key; + } + + /** + * To Proceed and validate Guarantee payment basic requirements in checkout + * + * @param integer $orderamount + * return string + */ + function proceedToGuranteePayment($orderamount) { + global $order; + // Delivery address + $delivery_address = array( + 'street_address' => $order->delivery['street_address'], + 'city' => $order->delivery['city'], + 'postcode' => $order->delivery['postcode'], + 'country' => $order->delivery['country']['iso_code_2'], + ); + // Billing address + $billing_address = array( + 'street_address' => $order->billing['street_address'], + 'city' => $order->billing['city'], + 'postcode' => $order->billing['postcode'], + 'country' => $order->billing['country']['iso_code_2'], + ); + $minimum_amount_gurantee = trim(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT) != '' ? trim(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT) : '2000'; + $maximum_amount_gurantee = trim(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT) != '' ? trim(MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT) : '500000'; + // Check guarantee payment + if (MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE == 'True') { + if (($orderamount >= $minimum_amount_gurantee && $orderamount <= $maximum_amount_gurantee) && in_array(strtoupper($order->billing['country']['iso_code_2']), array('DE', 'AT', 'CH')) && $order->info['currency'] == 'EUR' && $delivery_address === $billing_address) { + if (isset($_SESSION['novalnet'][$this->code]['guarantee_error'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee_error']); + } + $_SESSION['novalnet'][$this->code]['guarantee'] = TRUE; + } else if (MODULE_PAYMENT_NOVALNET_SEPA_FORCE == 'True') { + if (isset($_SESSION['novalnet'][$this->code]['guarantee'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee']); + } + } else { + $_SESSION['novalnet'][$this->code]['guarantee'] = TRUE; + $_SESSION['novalnet'][$this->code]['guarantee_error'] = TRUE; + return MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_ERROR; + } + } else { + if(isset($_SESSION['novalnet'][$this->code]['guarantee'])) { + unset($_SESSION['novalnet'][$this->code]['guarantee']); + } + } + } +} + diff --git a/lang/english/modules/payment/novalnet.php b/lang/english/modules/payment/novalnet.php new file mode 100644 index 0000000..d86c952 --- /dev/null +++ b/lang/english/modules/payment/novalnet.php @@ -0,0 +1,130 @@ +Novalnet Global Configuration (V_11.1.0)'); +define('MODULE_PAYMENT_NOVALNET_SELECT','-- SELECT -- '); +define('MODULE_PAYMENT_NOVALNET_NO_SCRIPT','Please enable the Javascript in your browser to proceed further with the payment'); +define('MODULE_PAYMENT_NOVALNET_OPTION_NONE','None'); +define('MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONCALLBACK','PIN by callback'); +define('MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONSMS', 'PIN by SMS'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS', 'Novalnet transaction details'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_CALLBACK_INPUT_TITLE','Telephone number'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_INPUT_TITLE','Mobile number'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_INFO' ,'You will shortly receive a transaction PIN through phone call to complete the payment'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_PIN_INFO','You will shortly receive an sms containing your transaction PIN to complete the payment'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_REQUEST_DESC', 'Transaction PIN'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_NEW_PIN', '  Forgot your PIN?'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_EMPTY', 'Enter your PIN'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_NOTVALID', 'The PIN you entered is incorrect'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_ERROR', 'The order amount has been changed, please proceed with the new order'); +define('MODULE_PAYMENT_NOVALNET_CONFIG_BLOCK_FUNC_ERROR', 'Mentioned PHP Package(s) not available in this Server. Please enable it.
'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_TELEPHONE_ERROR', 'Please enter your telephone number '); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_ERROR','Please enter your mobile number'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_REFUND_CONFIRM','Are you sure you want to refund the amount?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ZERO_AMOUNT_BOOK_CONFIRM','Are you sure you want to book the order amount?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_CAPTURE_CONFIRM','Are you sure you want to capture the payment?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_VOID_CONFIRM','Are you sure you want to cancel the payment?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_CANCEL_SUBSCRIPTION','Are you sure you want to cancel the subscription?'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_ID','Novalnet transaction ID: '); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE','Test order'); +define('MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE','The amount is invalid'); +define('MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR','Your account details are invalid'); +define('MODULE_PAYMENT_NOVALNET_VALID_MERCHANT_CREDENTIALS_ERROR','Please fill in all the mandatory fields'); +define('MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_TITLE','Manage transaction process'); +define('MODULE_PAYMENT_NOVALNET_SELECT_STATUS_TEXT', 'Please select status'); +define('MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_SUCCESSFUL_MESSAGE','The transaction has been confirmed on %s, %s'); +define('MODULE_PAYMENT_NOVALNET_TRANS_DEACTIVATED_MESSAGE','The transaction has been canceled on %s, %s'); +define('MODULE_PAYMENT_NOVALNET_REFUND_AMT_TITLE','Please enter the refund amount'); +define('MODULE_PAYMENT_NOVALNET_REFUND_TITLE','Refund process'); +define('MODULE_PAYMENT_NOVALNET_REFUND_PARENT_TID_MSG','The refund has been executed for the TID: %s with the amount of %s'); +define('MODULE_PAYMENT_NOVALNET_REFUND_CHILD_TID_MSG',' .Your new TID for the refund amount: %s'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_EX',' (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT','Confirm'); +define('MODULE_PAYMENT_NOVALNET_BACK_TEXT', 'Back'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT', 'Amount: '); +define('MODULE_PAYMENT_NOVALNET_UPDATE_TEXT','Update'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_REFERENCE_ERROR','Please select atleast one payment reference'); +define('MODULE_PAYMENT_NOVALNET_CANCEL_TEXT','Cancel'); +define('MODULE_PAYMENT_NOVALNET_SELECT_STATUS_OPTION', '--Select--'); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_TITLE','Cancel Subscription Process'); +define('MODULE_PAYMENT_NOVALNET_SUBS_SELECT_REASON','Please select reason'); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_MESSAGE','Subscription has been canceled due to: '); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_TITLE', 'Please select the reason of subscription cancellation'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_1','Product is costly'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_2','Cheating'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_3','Partner interfered'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_4', 'Financial problem'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_5','Content does not match my likes'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_6','Content is not enough'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_7','Interested only for a trial'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_8','Page is very slow'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_9','Satisfied customer'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_10','Logging in problems'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_11','Other'); +define('MODULE_PAYMENT_NOVALNET_BOOK_TITLE','Book transaction'); +define('MODULE_PAYMENT_NOVALNET_IBAN','IBAN'); +define('MODULE_PAYMENT_NOVALNET_INV_PRE_ACCOUNT_HOLDER','Account holder: NOVALNET AG'); +define('MODULE_PAYMENT_NOVALNET_DUE_DATE','Due date: '); +define('MODULE_PAYMENT_NOVALNET_BOOK_AMT_TITLE','Transaction booking amount'); +define('MODULE_PAYMENT_NOVALNET_TRANS_BOOKED_MESSAGE','Your order has been booked with the amount of %s. Your new TID for the booked amount: %s'); +define('MODULE_PAYMENT_NOVALNET_REFUND_PAYMENTTYPE_TITLE','Select the refund option'); +define('MODULE_PAYMENT_NOVALNET_PAYMENTTYPE_NONE', 'None'); +define('MODULE_PAYMENT_NOVALNET_SEPA_TEXT','Direct Debit SEPA'); +define('MODULE_PAYMENT_NOVALNET_BIC', ' BIC'); +define('MODULE_PAYMENT_NOVALNET_ACCOUNT_HOLDER','Account holder'); +define('MODULE_PAYMENT_NOVALNET_MAP_PAGE_HEADER', 'Login here with Novalnet merchant credentials. For the activation of new payment methods please contact support@novalnet.de'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_ERROR','Payment was not successful. An error occurred.'); +define('MODULE_PAYMENT_NOVALNET_REFUND_REFERENCE_TEXT','Refund reference'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_REDIRECT_ERROR', 'While redirecting some data has been changed. The hash check failed'); +define('MODULE_PAYMENT_NOVALNET_BANK','Bank: '); +define('MODULE_PAYMENT_NOVALNET_TRANS_AMOUNT_TITLE', 'Transaction Amount'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_DUE_DATE_TITLE' ,'Change the amount / due date'); +define('MODULE_PAYMENT_NOVALNET_TRANS_DUE_DATE_TITLE','Transaction due date'); +define('MODULE_PAYMENT_GUARANTEE_FIELD','Your date of birth'); +define('MODULE_PAYMENT_NOVALNET_VALID_DUEDATE_MESSAGE','The date should be in future'); +define('MODULE_PAYMENT_NOVALNET_INVPRE_REF','Payment Reference:'); +define('MODULE_PAYMENT_NOVALNET_INVPRE_REF_MULTI','Payment Reference%s:'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_SINGLE_TEXT','Please use the following payment reference for your money transfer, as only through this way your payment is matched and assigned to the order:'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_MULTI_TEXT','Please use any one of the following references as the payment reference, as only through this way your payment is matched and assigned to the order:'); +define('MODULE_PAYMENT_NOVALNET_ORDER_NUMBER',' Order number '); +define('MODULE_PAYMENT_NOVALNET_INVOICE_COMMENTS_PARAGRAPH', 'Please transfer the amount to the below mentioned account details of our payment processor Novalnet'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_TITLE', 'Enable fraud prevention'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_DESC', 'To authenticate the buyer for a transaction, the PIN will be automatically generated and sent to the buyer. This service is only available for customers from DE, AT, CH'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_AGE_ERROR_MESSAGE','You need to be at least 18 years old'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_EMPTY_ERROR_MESSAGE','Please enter your date of birth'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_INVAILD_DOB_ERROR_MESSAGE','The date format is invalid'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_ERROR_MESSAGE','Please enter valid birthdate'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_TITLE','Amount update'); +define('MODULE_PAYMENT_NOVALNET_VAILD_SUBSCRIPTION_PERIOD_ERROR','Please enter the valid subscription period'); +define('MODULE_PAYMENT_NOVALNET_ORDER_AMT_UPDATE_TEXT','Are you sure you want to change the order amount?'); +define('MODULE_PAYMENT_NOVALNET_ORDER_AMT_DATE_UPDATE_TEXT','Are you sure you want to change the order amount or due date?'); +define('MODULE_PAYMENT_NOVALNET_TRANS_UPDATED_MESSAGE','The transaction amount ( %s ) has been updated successfully on %s , %s'); +define('MODULE_PAYMENT_INVOICE_DUE_DATE_INVAILD','Invalid due date'); +define('MODULE_PAYMENT_INVOICE_CREDIT_COMMENTS','Novalnet Callback Script executed successfully for the TID: %s with amount: %s on %s & %s. Please refer PAID transaction in our Novalnet Merchant Administration with the TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGEBACK_COMMENTS','Novalnet callback received. Chargeback executed successfully for the TID: %s amount: %s on %s & %s. The subsequent TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_BOOKBACK_COMMENTS','Novalnet callback received. Refund/Bookback executed successfully for the TID: %s amount: %s on %s & %s. The subsequent TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_UPDATE_COMMENTS', 'Novalnet Callback Script executed successfully for the TID: %s with amount %s on %s & %s.'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGING_DATE_COMMENTS','Next charging date: %s '); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_REFERENCE_TID_COMMENTS',' Reference TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_SUBS_STOP_COMMENTS','Novalnet callback script received. Subscription has been stopped for the TID: %s on %s & %s.'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_RECURRING_COMMENTS' ,'Novalnet Callback Script executed successfully for the TID: %s with amount %s on %s %s . Please refer PAID transaction in our Novalnet Merchant Administration with the TID: %s.'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY_CANCEL_ORDER_MESSAGE' ,'The transaction has been canceled due to: %s'); +define('MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_HEADING' ,'Novalnet test order notification-%s '); +define('MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_CONTENT' ,'Dear client,

 We would like to inform you that test order %s has been placed in your shop recently.Please make sure your project is in LIVE mode at Novalnet administration portal and Novalnet payments are enabled in your shop system. Please ignore this email if the order has been placed by you for testing purpose.


Regards,
Novalnet AG'); diff --git a/lang/english/modules/payment/novalnet_cc.php b/lang/english/modules/payment/novalnet_cc.php new file mode 100644 index 0000000..ec69369 --- /dev/null +++ b/lang/english/modules/payment/novalnet_cc.php @@ -0,0 +1,93 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_CC_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_CC_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_CC_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_CC_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_CC_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_CC_3D_SECURE_TITLE','Enable 3D secure'); +define('MODULE_PAYMENT_NOVALNET_CC_3D_SECURE_DESC','The 3D-Secure will be activated for credit cards. The issuing bank prompts the buyer for a password what, in turn, help to prevent a fraudulent payment. It can be used by the issuing bank as evidence that the buyer is indeed their card holder. This is intended to help decrease a risk of charge-back.'); +define('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT_TITLE','Display AMEX logo'); +define('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT_DESC','Display AMEX logo in checkout page'); +define('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT_TITLE','Display Maestro logo'); +define('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT_DESC','Display Maestro logo in checkout page'); +define('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT_TITLE','Display CartaSi logo'); +define('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT_DESC','Display CartaSi logo in checkout page'); +define('MODULE_PAYMENT_NOVALNET_CC_SHOP_TYPE_TITLE','Shopping type'); +define('MODULE_PAYMENT_NOVALNET_CC_SHOP_TYPE_DESC','Select shopping type'); +define('MODULE_PAYMENT_NOVALNET_CC_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_CC_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_CC_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_CC_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_CC_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_CC_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_CC_ORDER_STATUS_TITLE','Order Completion Status'); +define('MODULE_PAYMENT_NOVALNET_CC_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_CC_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_CC_ONE_CLICK','One click shopping'); +define('MODULE_PAYMENT_NOVALNET_CC_ZERO_AMOUNT','Zero amount booking'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_TYPE','Credit Card type'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER','Card holder name'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO','Card number'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE','Expiry date'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC','CVC/CVV/CID'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_HINT','what is this?'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_ERROR','Your credit card details are invalid'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_HOLDER_INPUT_TEXT','Name on card'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_NUMBER_INPUT_TEXT','XXXX XXXX XXXX XXXX'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_EXPIRYDATE_INPUT_TEXT','MM / YYYY'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_INPUT_TEXT','XXX'); +define('MODULE_PAYMENT_NOVALNET_VALID_CC_DETAILS', 'Your credit card details are invalid'); +define('MODULE_PAYMENT_NOVALNET_CC_NEW_ACCOUNT', 'Enter new card details'); +define('MODULE_PAYMENT_NOVALNET_CC_GIVEN_ACCOUNT','Given card details'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_TITLE','

Form appearance

CSS settings for Credit Card fields

'.MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER.'

Label'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_INPUT_TITLE','Input field'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO.'

Label'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_INPUT_TITLE','Input field'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE.'

Label'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_INPUT_TITLE','Input field'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC.'

Label'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_INPUT_TITLE','Input field'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_TITLE','CSS settings for Credit Card iframe

Label'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_INPUT_TITLE','Input'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_TEXT_TITLE','CSS Text'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_TEXT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_PUBLIC_TITLE', 'Credit Card '. (((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True')?'Credit Card':''). +(((!defined('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Credit Card':'').' '. +(((!defined('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Credit Card':''). +(((!defined('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Credit Card':'')); diff --git a/lang/english/modules/payment/novalnet_config.php b/lang/english/modules/payment/novalnet_config.php new file mode 100644 index 0000000..008bc22 --- /dev/null +++ b/lang/english/modules/payment/novalnet_config.php @@ -0,0 +1,70 @@ +For additional configurations login to Novalnet Merchant Administration portal.
To login to the Portal you need to have an account at Novalnet. If you don't have one yet, please contact sales@novalnet.de / tel. +49 (089) 923068320

To use the PayPal payment method please enter your PayPal API details in Novalnet Merchant Administration portal'); +define('MODULE_PAYMENT_NOVALNET_PUBLIC_KEY_TITLE', 'Product activation key'); +define('MODULE_PAYMENT_NOVALNET_PUBLIC_KEY_DESC', 'Enter Novalnet Product activation key'); +define('MODULE_PAYMENT_NOVALNET_VENDOR_ID_TITLE', 'Merchant ID'); +define('MODULE_PAYMENT_NOVALNET_VENDOR_ID_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_AUTHCODE_TITLE', 'Authentication code'); +define('MODULE_PAYMENT_NOVALNET_AUTHCODE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_PRODUCT_ID_TITLE', 'Project ID'); +define('MODULE_PAYMENT_NOVALNET_PRODUCT_ID_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_TARIFF_ID_TITLE', 'Tariff ID'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_ID_DESC', 'Select Novalnet tariff ID'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY_TITLE', 'Payment access key'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT_TITLE', 'Set a limit for on-hold transaction (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT_DESC', 'In case the order amount exceeds mentioned limit, the transaction will be set on hold till your confirmation of transaction'); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION_TITLE', 'Enable E-mail notification for test transaction'); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION_DESC', 'You will receive email notifications about every test order in the web shop.'); +define('MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION_TITLE', 'Enable default payment method'); +define('MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION_DESC', 'For the registered users the last chosen payment method will be selected by default during the checkout'); +define('MODULE_PAYMENT_NOVALNET_PROXY_TITLE', 'Proxy server'); +define('MODULE_PAYMENT_NOVALNET_PROXY_DESC', 'Enter the IP address of your proxy server along with the port number in the following format IP Address : Port Number (if applicable)'); +define('MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT_TITLE', 'Gateway Timeout (in seconds)'); +define('MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT_DESC', 'In case the order processing time exceeds the gateway timeout, the order will not be placed'); +define('MODULE_PAYMENT_NOVALNET_REFERRER_ID_TITLE', 'Referrer ID'); +define('MODULE_PAYMENT_NOVALNET_REFERRER_ID_DESC', 'Enter the referrer ID of the person/company who recommended you Novalnet'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY_TITLE', '

Logos display management

You can activate or deactivate the logos display for the checkout page

Display payment method logo'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY_DESC', 'The payment method logo will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE_TITLE', '

Order status management for on-hold transaction(-s)

Confirmation order status'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED_TITLE', 'Cancellation order status'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD_TITLE', '

Dynamic subscription management

Tariff period'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD_DESC', 'The period of the first subscription cycle (E.g: 1d/1m/1y)'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT_TITLE', 'Amount for the subsequent subscription cycle (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT_DESC', 'The amount for the subsequent subscription cycle'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_TITLE', 'Period for subsequent subscription cycle'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_DESC', 'The period of the subsequent subscription cycle (E.g: 1d/1m/1y)'); +define('MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL_TITLE', 'Cancellation status of subscription'); +define('MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE_TITLE', '

Merchant script management

Enable debug mode'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE_DESC', 'Set the debug mode to execute the merchant script in debug mode'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE_TITLE', 'Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND_TITLE', 'Enable E-mail notification for callback'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO_TITLE', 'E-mail address (To)'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO_DESC', 'E-mail address of the recipient'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC_TITLE', 'E-mail address (Bcc)'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC_DESC', 'E-mail address of the recipient for BCC'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_URL_TITLE', 'Notification URL '); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_URL_DESC', 'The notification URL is used to keep your database/system actual and synchronizes with the Novalnet transaction status.'); diff --git a/lang/english/modules/payment/novalnet_eps.php b/lang/english/modules/payment/novalnet_eps.php new file mode 100644 index 0000000..28374d2 --- /dev/null +++ b/lang/english/modules/payment/novalnet_eps.php @@ -0,0 +1,41 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_EPS_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_EPS_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS_TITLE','Order completion status'); +define('MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_EPS_PUBLIC_TITLE', 'eps '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'eps':'')); diff --git a/lang/english/modules/payment/novalnet_giropay.php b/lang/english/modules/payment/novalnet_giropay.php new file mode 100644 index 0000000..dbdd7c1 --- /dev/null +++ b/lang/english/modules/payment/novalnet_giropay.php @@ -0,0 +1,42 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS_TITLE','Order completion status'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TITLE','GIROPAY Configuration'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PUBLIC_TITLE', 'giropay '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'giropay':'')); diff --git a/lang/english/modules/payment/novalnet_ideal.php b/lang/english/modules/payment/novalnet_ideal.php new file mode 100644 index 0000000..a899683 --- /dev/null +++ b/lang/english/modules/payment/novalnet_ideal.php @@ -0,0 +1,41 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS_TITLE','Order completion status'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PUBLIC_TITLE', 'iDEAL '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'iDEAL':'')); diff --git a/lang/english/modules/payment/novalnet_instantbank.php b/lang/english/modules/payment/novalnet_instantbank.php new file mode 100644 index 0000000..2992561 --- /dev/null +++ b/lang/english/modules/payment/novalnet_instantbank.php @@ -0,0 +1,41 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS_TITLE','Order completion status'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PUBLIC_TITLE', 'Instant Bank Transfer '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Instant Bank Transfer ':'')); diff --git a/lang/english/modules/payment/novalnet_invoice.php b/lang/english/modules/payment/novalnet_invoice.php new file mode 100644 index 0000000..e6b36bc --- /dev/null +++ b/lang/english/modules/payment/novalnet_invoice.php @@ -0,0 +1,68 @@ +Payment guarantee configuration

Basic requirements for Payment guarantee

Allowed countries: AT, DE, CH
Allowed currency: EUR
Minimum amount of order >= 20,00 EUR
Maximum amount of order <= 5.000,00 EUR
Minimum age of end customer >= 18 Years
The billing address must be the same as the shipping address
Gift certificates/vouchers are not allowed

Enable payment guarantee'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT_TITLE','Minimum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT_DESC','This setting will override the default setting made in the minimum order amount. Note that amount should be in the range of 20,00 EUR - 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT_TITLE','Maximum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT_DESC','This setting will override the default setting made in the maximum order amount. Note that amount should be greater than minimum order amount, but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INVOICE_FORCE_TITLE','Force Non-guarantee payment'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_FORCE_DESC','If the payment guarantee is activated (True), but the above mentioned requirements are not met, the payment should be processed as non-guarantee payment.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_BLOCK_TITLE','Invoice Configuration'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE_ERROR','Please enter valid due date'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_ERROR','The payment cannot be processed, because the basic requirements haven’t been met.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_AMOUNT_ERROR','The minimum amount should be at least 20,00 EUR but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_AMOUNT_ERROR','The maximum amount should be greater than minimum order amount, but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_PUBLIC_TITLE', 'Invoice '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Invoice':'')); diff --git a/lang/english/modules/payment/novalnet_paypal.php b/lang/english/modules/payment/novalnet_paypal.php new file mode 100644 index 0000000..a7578e0 --- /dev/null +++ b/lang/english/modules/payment/novalnet_paypal.php @@ -0,0 +1,54 @@ +In order to use this option you must have billing agreement option enabled in your PayPal account. Please contact your account manager at PayPal.'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ONE_CLICK','One click shopping'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ZERO_AMOUNT','Zero amount booking'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_NEW_ACCOUNT', 'Proceed with new PayPal account details'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_GIVEN_ACCOUNT','Given PayPal account details'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANSACTION_TID','PayPal transaction ID'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ORDER_TRANSACTION_TID','Novalnet transaction ID'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ONE_CLICK_TEXT_DESCRIPTION','Once the order is submitted, the payment will be processed as a reference transaction at Novalnet'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_BLOCK_TITLE','PayPal API Configuration'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PUBLIC_TITLE', 'PayPal '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'PayPal':'')); diff --git a/lang/english/modules/payment/novalnet_prepayment.php b/lang/english/modules/payment/novalnet_prepayment.php new file mode 100644 index 0000000..220863d --- /dev/null +++ b/lang/english/modules/payment/novalnet_prepayment.php @@ -0,0 +1,50 @@ +Prepayment Configuration'); +define('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PUBLIC_TITLE', 'Prepayment '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Prepayment':'')); diff --git a/lang/english/modules/payment/novalnet_przelewy24.php b/lang/english/modules/payment/novalnet_przelewy24.php new file mode 100644 index 0000000..e6df371 --- /dev/null +++ b/lang/english/modules/payment/novalnet_przelewy24.php @@ -0,0 +1,43 @@ +Please don't close the browser after successful payment, until you have been redirected back to the Shop'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED_TITLE','Allowed zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED_DESC','This payment method will be allowed for the mentioned zone(-s). Enter the zone(-s) in the following format E.g: DE, AT, CH. In case if the field is empty, all the zones will be allowed.'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE_TITLE','Enable payment method'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE_TITLE','Enable test mode'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE_DESC','The payment will be processed in the test mode therefore amount for this transaction will not be charged'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT_TITLE','Minimum value of goods (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT_DESC','Enter the minimum value of goods from which the payment method is displayed to the customer during checkout'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO_TITLE','Notification for the buyer'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO_DESC','The entered text will be displayed on the checkout page'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER_TITLE','Define a sorting order'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER_DESC','This payment method will be sorted among others (in the ascending order) as per the given sort number.'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS_TITLE','Order completion status'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS_TITLE','Order status for the pending payment'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE_TITLE','Payment zone'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE_DESC','This payment method will be displayed for the mentioned zone(-s)'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1_TITLE','Transaction reference 1'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2_TITLE','Transaction reference 2'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2_DESC','This reference will appear in your bank account statement'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PUBLIC_TITLE', 'Przelewy24 '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'przelewy24':'')); diff --git a/lang/english/modules/payment/novalnet_sepa.php b/lang/english/modules/payment/novalnet_sepa.php new file mode 100644 index 0000000..6b67015 --- /dev/null +++ b/lang/english/modules/payment/novalnet_sepa.php @@ -0,0 +1,77 @@ + I hereby grant the SEPA direct debit mandate and confirm that the given IBAN and BIC are correct'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE_TITLE','SEPA payment duration (in days)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE_DESC','Enter the number of days after which the payment should be processed (must be greater than 6 days)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL_TITLE','Enable auto-fill'); +define('MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL_DESC','The payment details will be filled automatically in the payment form during the checkout process'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_TITLE','

Payment guarantee configuration

Basic requirements for Payment guarantee

Allowed countries: AT, DE, CH
Allowed currency: EUR
Minimum amount of order >= 20,00 EUR
Maximum amount of order <= 5.000,00 EUR
Minimum age of end customer >= 18 Years
The billing address must be the same as the shipping address
Gift certificates/vouchers are not allowed

Enable payment guarantee'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_ERROR','The payment cannot be processed, because the basic requirements haven’t been met.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT_TITLE','Minimum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT_DESC','This setting will override the default setting made in the minimum order amount. Note that amount should be in the range of 20,00 EUR - 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT_TITLE','Maximum order amount (in minimum unit of currency. E.g. enter 100 which is equal to 1.00)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT_DESC','This setting will override the default setting made in the maximum order amount. Note that amount should be greater than minimum order amount, but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_AMOUNT_ERROR','The minimum amount should be at least 20,00 EUR but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_AMOUNT_ERROR','The maximum amount should be greater than minimum order amount, but not more than 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_FORCE_TITLE','Force Non-guarantee payment'); +define('MODULE_PAYMENT_NOVALNET_SEPA_FORCE_DESC','If the payment guarantee is activated (True), but the above mentioned requirements are not met, the payment should be processed as non-guarantee payment.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_BLOCK_TITLE','SEPA Configuration'); +define('MODULE_PAYMENT_NOVALNET_SEPA_DUE_DATE_ERROR','SEPA Due date is not valid'); +define('MODULE_PAYMENT_NOVALNET_SEPA_MANDATE_CONFIRM_ERROR','Please accept the SEPA direct debit mandate'); +define('MODULE_PAYMENT_NOVALNET_SEPA_SELECT_COUNTRY','Please select the country'); +define('MODULE_PAYMENT_NOVALNET_SELECT_PAYMENT_METHOD','Please select the payment method'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PUBLIC_TITLE', 'Direct Debit SEPA '. (((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True')?' Direct Debit SEPA':'')); diff --git a/lang/german/modules/payment/novalnet.php b/lang/german/modules/payment/novalnet.php new file mode 100644 index 0000000..d57f62b --- /dev/null +++ b/lang/german/modules/payment/novalnet.php @@ -0,0 +1,130 @@ +Novalnet Haupteinstellungen (V_11.1.0)'); +define('MODULE_PAYMENT_NOVALNET_SELECT','-- Auswählen -- '); +define('MODULE_PAYMENT_NOVALNET_NO_SCRIPT','Aktivieren Sie bitte JavaScript in Ihrem Browser, um die Zahlung fortzusetzen'); +define('MODULE_PAYMENT_NOVALNET_OPTION_NONE','Keiner'); +define('MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONCALLBACK','PIN-by-Callback'); +define('MODULE_PAYMENT_NOVALNET_FRAUD_OPTIONSMS', 'PIN-by-SMS'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_CALLBACK_INPUT_TITLE','Telefonnummer'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_INPUT_TITLE','Mobiltelefonnummer'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_INFO' ,'In Kürze erhalten Sie einen Telefonanruf mit der PIN zu Ihrer Transaktion, um die Zahlung abzuschließen'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_PIN_INFO','In Kürze erhalten Sie eine SMS mit der PIN zu Ihrer Transaktion, um die Zahlung abzuschließen.'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_REFUND_CONFIRM','Sind Sie sicher, dass Sie den Betrag zurückerstatten möchten?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ZERO_AMOUNT_BOOK_CONFIRM','Sind Sie sich sicher, dass Sie den Bestellbetrag buchen wollen?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_CAPTURE_CONFIRM','Sind Sie sicher, dass Sie die Zahlung einziehen möchten?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_CANCEL_SUBSCRIPTION','Sind Sie sicher, dass Sie das Abonnement kündigen wollen?'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_VOID_CONFIRM','Sind Sie sicher, dass Sie die Zahlung stornieren wollen?'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_REQUEST_DESC', 'PIN zu Ihrer Transaktion'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_NEW_PIN', '  PIN vergessen?'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_EMPTY', 'PIN eingeben'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_PIN_NOTVALID', 'Die von Ihnen eingegebene PIN ist falsch'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_ERROR', 'Der Bestellbetrag hat sich geändert, setzen Sie bitte die neue Bestellung fort'); +define('MODULE_PAYMENT_NOVALNET_CONFIG_BLOCK_FUNC_ERROR','Erwähnt PHP-Paket (e) in diesem Server nicht verfügbar ist. Bitte aktivieren Sie sie.
'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_TELEPHONE_ERROR','Geben Sie bitte Ihre Telefonnummer ein'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_SMS_ERROR', 'Geben Sie bitte Ihre Mobiltelefonnummer ein.'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_DETAILS', 'Novalnet-Transaktionsdetails'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_ID','Novalnet Transaktions-ID: '); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_MESSAGE','Testbestellung'); +define('MODULE_PAYMENT_NOVALNET_IBAN','IBAN'); +define('MODULE_PAYMENT_GUARANTEE_FIELD','Ihr Geburtsdatum'); +define('MODULE_PAYMENT_NOVALNET_ACCOUNT_HOLDER','Kontoinhaber'); +define('MODULE_PAYMENT_NOVALNET_TEST_MODE_MSG','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen.'); +define('MODULE_PAYMENT_NOVALNET_VALID_DUEDATE_MESSAGE','Das Datum sollte in der Zukunft liegen.'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_ERROR_MESSAGE','Geben Sie ein gültiges Geburtsdatum ein'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_ERROR_MESSAGE','Ungültiger Betrag'); +define('MODULE_PAYMENT_NOVALNET_VALID_MERCHANT_CREDENTIALS_ERROR','Füllen Sie bitte alle Pflichtfelder aus.'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_REFERENCE_ERROR','Wählen Sie mindestens einen Verwendungszweck aus'); +define('MODULE_PAYMENT_NOVALNET_VALID_ACCOUNT_CREDENTIALS_ERROR','Ihre Kontodaten sind ungültig.'); +define('MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_TITLE','Ablauf der Buchung steuern'); +define('MODULE_PAYMENT_NOVALNET_SELECT_STATUS_TEXT', 'Wählen Sie bitte einen Status aus'); +define('MODULE_PAYMENT_NOVALNET_TRANS_CONFIRM_SUCCESSFUL_MESSAGE','Die Buchung wurde am %s um %s Uhr bestätigt.'); +define('MODULE_PAYMENT_NOVALNET_TRANS_DEACTIVATED_MESSAGE','Die Transaktion wurde am %s um %s Uhr storniert.'); +define('MODULE_PAYMENT_NOVALNET_REFUND_AMT_TITLE','Geben Sie bitte den erstatteten Betrag ein'); +define('MODULE_PAYMENT_NOVALNET_REFUND_TITLE','Ablauf der Rückerstattung'); +define('MODULE_PAYMENT_NOVALNET_REFUND_PARENT_TID_MSG','Die Rückerstattung wurde für die TID: %s mit dem Betrag %s durchgeführt.'); +define('MODULE_PAYMENT_NOVALNET_REFUND_CHILD_TID_MSG',' Ihre neue TID für den erstatteten Betrag: %s'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_EX',' (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT', 'Betrag: '); +define('MODULE_PAYMENT_NOVALNET_CONFIRM_TEXT','Bestätigen'); +define('MODULE_PAYMENT_NOVALNET_BACK_TEXT', 'Zurück'); +define('MODULE_PAYMENT_NOVALNET_UPDATE_TEXT','Ändern'); +define('MODULE_PAYMENT_NOVALNET_CANCEL_TEXT','Stornieren'); +define('MODULE_PAYMENT_NOVALNET_SELECT_STATUS_OPTION', '--Auswählen--'); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_TITLE','Stornierung von Abonnements'); +define('MODULE_PAYMENT_NOVALNET_SUBS_SELECT_REASON','Wählen Sie bitte den Grund aus'); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_MESSAGE','Das Abonnement wurde gekündigt wegen: '); +define('MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_TITLE', 'Wählen Sie bitte den Grund für die Abonnementskündigung aus.'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_1','Angebot zu teuer'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_2','Betrug'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_3','(Ehe-)Partner hat Einspruch eingelegt'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_4', 'Finanzielle Schwierigkeiten'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_5','Inhalt entsprach nicht meinen Vorstellungen'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_6','Inhalte nicht ausreichend'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_7','Nur an Probezugang interessiert'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_8','Seite zu langsam'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_9','Zufriedener Kunde'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_10','Zugangsprobleme'); +define('MODULE_PAYMENT_NOVALNET_SUBS_REASON_11','Sonstige'); +define('MODULE_PAYMENT_NOVALNET_BOOK_TITLE','Transaktion durchführen'); +define('MODULE_PAYMENT_NOVALNET_BOOK_AMT_TITLE','Buchungsbetrag der Transaktion'); +define('MODULE_PAYMENT_NOVALNET_TRANS_BOOKED_MESSAGE','Ihre Bestellung wurde mit einem Betrag von %s gebucht. Ihre neue TID für den gebuchten Betrag: %s'); +define('MODULE_PAYMENT_NOVALNET_REFUND_PAYMENTTYPE_TITLE','Wählen Sie die Option Rückerstattung aus.'); +define('MODULE_PAYMENT_NOVALNET_PAYMENTTYPE_NONE', 'Keiner'); +define('MODULE_PAYMENT_NOVALNET_SEPA_TEXT','Lastschrift SEPA'); +define('MODULE_PAYMENT_NOVALNET_BIC', 'BIC'); +define('MODULE_PAYMENT_NOVALNET_INV_PRE_ACCOUNT_HOLDER','Kontoinhaber: NOVALNET AG'); +define('MODULE_PAYMENT_NOVALNET_DUE_DATE','Fälligkeitsdatum: '); +define('MODULE_PAYMENT_NOVALNET_MAP_PAGE_HEADER','Loggen Sie sich hier mit Ihren Novalnet Händler-Zugangsdaten ein.Um neue Zahlungsarten zu aktivieren, kontaktieren Sie bitte support@novalnet.de'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_ERROR','Die Zahlung war nicht erfolgreich. Ein Fehler trat auf.'); +define('MODULE_PAYMENT_NOVALNET_REFUND_REFERENCE_TEXT', 'Referenz für die Rückerstattung'); +define('MODULE_PAYMENT_NOVALNET_TRANSACTION_REDIRECT_ERROR', 'Während der Umleitung wurden einige Daten geändert. Die Überprüfung des Hashes schlug fehl.'); +define('MODULE_PAYMENT_NOVALNET_BANK','Bank: '); +define('MODULE_PAYMENT_NOVALNET_INVPRE_REF','Verwendungszweck: '); +define('MODULE_PAYMENT_NOVALNET_INVPRE_REF_MULTI','%s.Verwendungszweck: '); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_SINGLE_TEXT','Bitte verwenden Sie nun der unten angegebenen Verwendungszweck für die Überweisung, da nur so Ihr Geldeingang zugeordnet werden kann:'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_MULTI_TEXT','Bitte verwenden Sie einen der unten angegebenen Verwendungszwecke für die Überweisung, da nur so Ihr Geldeingang zugeordnet werden kann:'); +define('MODULE_PAYMENT_NOVALNET_ORDER_NUMBER',' Bestellnummer '); +define('MODULE_PAYMENT_NOVALNET_INVOICE_COMMENTS_PARAGRAPH', 'Überweisen Sie bitte den Betrag an die unten aufgeführte Bankverbindung unseres Zahlungsdienstleisters Novalnet.'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_TITLE', 'Betrugsprüfung aktivieren'); +define('MODULE_PAYMENT_NOVALNET_FRAUDMODULE_DESC', 'Um den Käufer einer Transaktion zu authentifizieren, werden die PIN automatisch generiert und an den Käufer geschickt. Dieser Dienst wird nur für Kunden aus DE, AT und CH angeboten'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_AGE_ERROR_MESSAGE','Sie müssen mindestens 18 Jahre alt sein'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_DOB_EMPTY_ERROR_MESSAGE','Geben Sie bitte Ihr Geburtsdatum ein'); +define('MODULE_PAYMENT_GUARANTEE_PAYMENT_INVAILD_DOB_ERROR_MESSAGE','Ungültiges Datumsformat'); +define('MODULE_PAYMENT_NOVALNET_TRANS_DUE_DATE_TITLE','Fälligkeitsdatum der Transaktion'); +define('MODULE_PAYMENT_NOVALNET_TRANS_AMOUNT_TITLE', 'Transaktionsbetrag'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_DUE_DATE_TITLE' ,'Betrag / Fälligkeitsdatum ändern'); +define('MODULE_PAYMENT_NOVALNET_AMOUNT_CHANGE_TITLE','Betrag ändern'); +define('MODULE_PAYMENT_NOVALNET_ORDER_AMT_UPDATE_TEXT','Sind Sie sich sicher, dass Sie den Bestellbetrag ändern wollen?'); +define('MODULE_PAYMENT_NOVALNET_ORDER_AMT_DATE_UPDATE_TEXT','Sind Sie sich sicher, dass Sie den Betrag / das Fälligkeitsdatum der Bestellung ändern wollen?'); +define('MODULE_PAYMENT_NOVALNET_VAILD_SUBSCRIPTION_PERIOD_ERROR','Geben Sie bitte eine gültige Abonnementsperiode ein'); +define('MODULE_PAYMENT_NOVALNET_TRANS_UPDATED_MESSAGE','Der Betrag der Transaktion ( %s ) wurde am %s um %s Uhr erfolgreich geändert'); +define('MODULE_PAYMENT_INVOICE_DUE_DATE_INVAILD','Ungültiges Fälligkeitsdatum'); +define('MODULE_PAYMENT_INVOICE_CREDIT_COMMENTS','Novalnet-Callback-Skript erfolgreich ausgeführt für die TID: %s mit dem Betrag %s am %s um %s Uhr. Bitte suchen Sie nach der bezahlten Transaktion in unserer Novalnet-Händleradministration mit der TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGEBACK_COMMENTS' ,'Novalnet-Callback-Nachricht erhalten: Chargeback erfolgreich importiert für die TID: %s Betrag: %s am %s um %s. TID der Folgebuchung: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_BOOKBACK_COMMENTS' ,'Novalnet-Callback-Meldung erhalten: Rückerstattung / Bookback erfolgreich ausgeführt für die TID: %s Betrag: %s on %s & %s. TID der Folgebuchung: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_UPDATE_COMMENTS' ,'Novalnet-Callback-Skript erfolgreich ausgeführt für die TID: %s mit dem Betrag %s am %s um %s Uhr.'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_CHARGING_DATE_COMMENTS' ,'Nächstes Belastungsdatum: %s '); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_REFERENCE_TID_COMMENTS',' Verwendungszweck TID: %s'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_SUBS_STOP_COMMENTS','Nachricht vom Novalnet-Callback-Skript erhalten: Das Abonnement wurde für die TID: %s am %s um %s Uhr eingestellt.'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_RECURRING_COMMENTS','Novalnet-Callback-Skript erfolgreich ausgeführt für die TID: %s mit dem Betrag %s am , um %s %s Uhr.Bitte suchen Sie nach der bezahlten Transaktion in unserer Novalnet-Händleradministration mit der TID: %s.'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY_CANCEL_ORDER_MESSAGE' ,'Die Transaktion wurde storniert. Grund: %s'); +define('MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_HEADING' ,'Benachrichtigung zu Novalnet-Testbestellung-%s'); +define('MODULE_PAYMENT_NOVALNET_TEST_TRANSACTION_EMAIL_CONTENT' ,'Sehr geehrte Kundin,

 wir möchten Sie darüber informieren, dass eine Testbestellung %s kürzlich in Ihrem Shop durchgeführt wurde. Stellen Sie bitte sicher, dass für Ihr Projekt im Novalnet-Administrationsportal der Live-Modus gesetzt wurde und Zahlungen über Novalnet in Ihrem Shopsystem aktiviert sind. Ignorieren Sie bitte diese E-Mail, falls die Bestellung von Ihnen zu Testzwecken durchgeführt wurde.


Mit freundlichen Grüßen
Novalnet AG'); diff --git a/lang/german/modules/payment/novalnet_cc.php b/lang/german/modules/payment/novalnet_cc.php new file mode 100644 index 0000000..ac15976 --- /dev/null +++ b/lang/german/modules/payment/novalnet_cc.php @@ -0,0 +1,93 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden. '); +define('MODULE_PAYMENT_NOVALNET_CC_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_CC_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_CC_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CC_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CC_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_CC_3D_SECURE_TITLE','3D-Secure aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CC_3D_SECURE_DESC','3D-Secure wird für Kreditkarten aktiviert. Die kartenausgebende Bank fragt vom Käufer ein Passwort ab, welches helfen soll, betrügerische Zahlungen zu verhindern. Dies kann von der kartenausgebenden Bank als Beweis verwendet werden, dass der Käufer tatsächlich der Inhaber der Kreditkarte ist. Damit soll das Risiko von Chargebacks verringert werden'); +define('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT_TITLE','AMEX-Logo anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT_DESC','AMEX-Logo auf der Checkout-Seite anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT_TITLE','Maestro-Logo anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT_DESC','Maestro-Logo auf der Checkout-Seite anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT_TITLE','CartaSi-Logo anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT_DESC','CartaSi-Logo auf der Checkout-Seite anzeigen'); +define('MODULE_PAYMENT_NOVALNET_CC_SHOP_TYPE_TITLE','Einkaufstyp'); +define('MODULE_PAYMENT_NOVALNET_CC_SHOP_TYPE_DESC','Einkaufstyp auswählen '); +define('MODULE_PAYMENT_NOVALNET_CC_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_CC_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_CC_ENDCUSTOMER_INFO_TITLE','Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_CC_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_CC_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_CC_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_CC_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_CC_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_CC_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_CC_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_CC_ONE_CLICK','Kauf mit einem Klick'); +define('MODULE_PAYMENT_NOVALNET_CC_ZERO_AMOUNT','Transaktionen mit Betrag 0'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_TYPE','Kreditkartentyp'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER','Name des Karteninhabers'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO','Kreditkartennummer'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE','Ablaufdatum'); +define('MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC','CVC/CVV/CID'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_HINT','Was ist das?'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_ERROR','Ihre Kreditkartendaten sind ungültig'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_HOLDER_INPUT_TEXT','Name auf der Kreditkarte'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_NUMBER_INPUT_TEXT','XXXX XXXX XXXX XXXX'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_EXPIRYDATE_INPUT_TEXT','MM / YYYY'); +define('MODULE_PAYMENT_NOVALNET_CC_IFRAME_CVC_INPUT_TEXT','XXX'); +define('MODULE_PAYMENT_NOVALNET_VALID_CC_DETAILS', 'Ihre Kreditkartendaten sind ungültig.'); +define('MODULE_PAYMENT_NOVALNET_CC_NEW_ACCOUNT', 'Neue Kartendaten eingeben'); +define('MODULE_PAYMENT_NOVALNET_CC_GIVEN_ACCOUNT','Eingegebene Kartendaten'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_TITLE','

Darstellung des Formulars

CSS-Einstellungen für Felder mit Kreditkartendaten

'.MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_HOLDER.'

Beschriftung'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_INPUT_TITLE','Eingabefeld'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_HOLDER_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_NO.'

Beschriftung'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_INPUT_TITLE','Eingabefeld'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_NUMBER_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_VALID_DATE.'

Beschriftung'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_INPUT_TITLE','Eingabefeld'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_EXPIRY_DATE_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_TITLE',MODULE_PAYMENT_NOVALNET_CC_FORM_CARD_CVC.'

Beschriftung'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_INPUT_TITLE','Eingabefeld'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_CARD_CVC_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_TITLE','

CSS-Einstellungen für den iFrame mit Kreditkartendaten

Beschriftung'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_INPUT_TITLE','Eingabe'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_STANDARD_STYLE_INPUT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_TEXT_TITLE','Text für das CSS'); +define('MODULE_PAYMENT_NOVALNET_CC_CSS_TEXT_DESC',''); +define('MODULE_PAYMENT_NOVALNET_CC_PUBLIC_TITLE', 'Kreditkarte '. (((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True')?'Kreditkarte':''). +(((!defined('MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_AMEX_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Kreditkarte':'').' '. +(((!defined('MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_MAESTRO_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Kreditkarte':''). +(((!defined('MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT')) || MODULE_PAYMENT_NOVALNET_CC_CARTASI_ACCEPT == 'True' && ((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True'))?'Kreditkarte':'')); diff --git a/lang/german/modules/payment/novalnet_config.php b/lang/german/modules/payment/novalnet_config.php new file mode 100644 index 0000000..19908ce --- /dev/null +++ b/lang/german/modules/payment/novalnet_config.php @@ -0,0 +1,70 @@ + Um zusätzliche Einstellungen vorzunehmen, loggen Sie sich in das Novalnet-Händleradministrationsportal ein.
Um sich in das Portal einzuloggen, benötigen Sie einen Account bei Novalnet. Falls Sie diesen noch nicht haben, kontaktieren Sie bitte sales@novalnet.de (Tel: +49 (089) 923068320).

Um die Zahlungsart PayPal zu verwenden, geben Sie bitte Ihre PayPal-API-Daten in das Novalnet-Händleradministrationsportal ein.'); +define('MODULE_PAYMENT_NOVALNET_PUBLIC_KEY_TITLE', 'Aktivierungsschlüssel des Produkts'); +define('MODULE_PAYMENT_NOVALNET_PUBLIC_KEY_DESC', 'Novalnet-Aktivierungsschlüssel für das Produkt eingeben'); +define('MODULE_PAYMENT_NOVALNET_VENDOR_ID_TITLE', 'Händler-ID'); +define('MODULE_PAYMENT_NOVALNET_VENDOR_ID_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_AUTHCODE_TITLE', 'Authentifizierungscode'); +define('MODULE_PAYMENT_NOVALNET_AUTHCODE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_PRODUCT_ID_TITLE', 'Projekt-ID'); +define('MODULE_PAYMENT_NOVALNET_PRODUCT_ID_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_TARIFF_ID_TITLE', 'Tarif-ID'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_ID_DESC', 'Novalnet-Tarif-ID auswählen'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY_TITLE', 'Zahlungs-Zugriffsschlüssel'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_ACCESS_KEY_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT_TITLE', 'Limit für onhold-Buchungen setzen (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_MANUAL_CHECK_LIMIT_DESC', 'Falls der Bestellbetrag das angegebene Limit übersteigt, wird die Transaktion ausgesetzt, bis Sie diese selbst bestätigen'); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION_TITLE', 'E-Mail-Benachrichtigung für Testbuchungen aktivieren'); +define('MODULE_PAYMENT_NOVALNET_TEST_ORDER_EMAIL_NOTIFICATION_DESC', 'Sie erhalten ab jetzt E-Mail-Benachrichtigungen zu jeder Testbestellung im Webshop'); +define('MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION_TITLE', 'Default-Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_LAST_SUCCESSFULL_PAYMENT_SELECTION_DESC', 'Für registrierte Benutzer wird die letzte ausgewählte Zahlungsart als Standardeinstellung beim Checkout ausgewählt'); +define('MODULE_PAYMENT_NOVALNET_PROXY_TITLE', 'Proxy-Server'); +define('MODULE_PAYMENT_NOVALNET_PROXY_DESC', 'Geben Sie die IP-Adresse Ihres Proxyservers zusammen mit der Nummer des Ports ein und zwar in folgendem Format: IP-Adresse : Nummer des Ports (falls notwendig)'); +define('MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT_TITLE', 'Zeitlimit der Schnittstelle (in Sekunden)'); +define('MODULE_PAYMENT_NOVALNET_GATEWAY_TIMEOUT_DESC', 'Falls die Verarbeitungszeit der Bestellung das Zeitlimit der Schnittstelle überschreitet, wird die Bestellung nicht ausgeführt.'); +define('MODULE_PAYMENT_NOVALNET_REFERRER_ID_TITLE', 'Partner-ID'); +define('MODULE_PAYMENT_NOVALNET_REFERRER_ID_DESC', 'Geben Sie die Partner-ID der Person / des Unternehmens ein, welche / welches Ihnen Novalnet empfohlen hat'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY_TITLE', '

Steuerung der angezeigten Logos

Sie können die Anzeige der Logos auf der Checkout-Seite aktivieren oder deaktivieren

Logo der Zahlungsart anzeigen'); +define('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY_DESC', 'Das Logo der Zahlungsart wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE_TITLE', '

Verwaltung des Bestellstatus für ausgesetzte Zahlungen

Bestellstatus für Bestätigung'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_COMPLETE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED_TITLE', 'Bestellstatus für Stornierung'); +define('MODULE_PAYMENT_NOVALNET_ONHOLD_ORDER_CANCELLED_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD_TITLE', '

Verwaltung dynamischer Abonnements

Zeitraum des Tarifs'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD_DESC', 'Zeitraum des ersten Abonnementzyklus (z.B. 1d/1m/1y)'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT_TITLE', 'Betrag für den folgenden Abonnementzyklus (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_AMOUNT_DESC', 'Betrag für den folgenden Abonnementzyklus'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_TITLE', 'Zeitraum für den folgenden Abonnementzyklus'); +define('MODULE_PAYMENT_NOVALNET_TARIFF_PERIOD2_DESC', 'Zeitraum des folgenden Abonnementzyklus (z.B. 1d/1m/1y)'); +define('MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL_TITLE', 'Stornierungsstatus des Abonnements'); +define('MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE_TITLE', '

Verwaltung des Händlerskripts

Debugmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_DEBUG_MODE_DESC', 'Setzen Sie den Debugmodus, um das Händlerskript im Debugmodus aufzurufen'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE_TITLE', 'Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_TEST_MODE_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND_TITLE', 'Email-Benachrichtigung für Callback aktivieren'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_SEND_DESC', ''); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO_TITLE', 'Emailadresse (An)'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_TO_DESC', 'Emailadresse des Empfängers'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC_TITLE', 'Emailadresse (Bcc)'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_MAIL_BCC_DESC', 'Emailadresse des Empfängers für Bcc'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_URL_TITLE', 'URL für Benachrichtigungen'); +define('MODULE_PAYMENT_NOVALNET_CALLBACK_URL_DESC', 'Der URL für Benachrichtigungen dient dazu, Ihre Datenbank / Ihr System auf einem aktuellen Stand zu halten und den Novalnet-Transaktionsstatus abzugleichen'); diff --git a/lang/german/modules/payment/novalnet_eps.php b/lang/german/modules/payment/novalnet_eps.php new file mode 100644 index 0000000..eac2267 --- /dev/null +++ b/lang/german/modules/payment/novalnet_eps.php @@ -0,0 +1,41 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden'); +define('MODULE_PAYMENT_NOVALNET_EPS_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_EPS_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_EPS_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_EPS_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO_TITLE','Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_EPS_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_EPS_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_EPS_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_EPS_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_EPS_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_EPS_PUBLIC_TITLE', 'eps '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'eps':'')); diff --git a/lang/german/modules/payment/novalnet_giropay.php b/lang/german/modules/payment/novalnet_giropay.php new file mode 100644 index 0000000..42c01c3 --- /dev/null +++ b/lang/german/modules/payment/novalnet_giropay.php @@ -0,0 +1,42 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO_TITLE','Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_TITLE','GIROPAY Konfiguration'); +define('MODULE_PAYMENT_NOVALNET_GIROPAY_PUBLIC_TITLE', 'giropay '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'giropay':'')); diff --git a/lang/german/modules/payment/novalnet_ideal.php b/lang/german/modules/payment/novalnet_ideal.php new file mode 100644 index 0000000..8369832 --- /dev/null +++ b/lang/german/modules/payment/novalnet_ideal.php @@ -0,0 +1,41 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO_TITLE', 'Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_IDEAL_PUBLIC_TITLE', 'iDEAL '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'IDEAL':'')); diff --git a/lang/german/modules/payment/novalnet_instantbank.php b/lang/german/modules/payment/novalnet_instantbank.php new file mode 100644 index 0000000..86b9e7e --- /dev/null +++ b/lang/german/modules/payment/novalnet_instantbank.php @@ -0,0 +1,41 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO_TITLE','Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_INSTANTBANK_PUBLIC_TITLE', 'Sofortüberweisung'.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Sofortüberweisung ':'')); diff --git a/lang/german/modules/payment/novalnet_invoice.php b/lang/german/modules/payment/novalnet_invoice.php new file mode 100644 index 0000000..44009a8 --- /dev/null +++ b/lang/german/modules/payment/novalnet_invoice.php @@ -0,0 +1,68 @@ +Einstellungen für die Zahlungsgarantie

Grundanforderungen für die Zahlungsgarantie

Zugelassene Staaten: AT, DE, CH
Zugelassene Währung: EUR
Mindestbetrag der Bestellung >= 20,00 EUR
Maximalbetrag der Bestellung <= 5.000,00 EUR
Mindestalter des Endkunden >= 18 Jahre
Rechnungsadresse und Lieferadresse müssen übereinstimmen
Geschenkgutscheine / Coupons sind nicht erlaubt

Zahlungsgarantie aktivieren'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT_TITLE','Mindestbestellbetrag (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_ORDER_AMOUNT_DESC','Diese Einstellung wird den Standardwert für den Mindestbestellbetrag überschreiben. Beachten Sie, dass der Betrag im Bereich von 20,00 EUR – 5.000,00 EUR liegen muss.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT_TITLE','Maximaler Bestellbetrag (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_ORDER_AMOUNT_DESC','Diese Einstellung wird den Standardwert für den Maximal-Bestellbetrag überschreiben. Beachten Sie, dass dieser Betrag größer als der Mindestbestellbetrag sein sollte, jedoch nicht höher als 5.000,00 EUR.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_INVOICE_FORCE_TITLE','Zahlung ohne Zahlungsgarantie erzwingen'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_FORCE_DESC','Falls die Zahlungsgarantie aktiviert ist (wahr), die oben genannten Anforderungen jedoch nicht erfüllt werden, soll die Zahlung ohne Zahlungsgarantie verarbeitet werden.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_BLOCK_TITLE','Kauf auf Rechnung Konfiguration'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_DUE_DATE_ERROR','Geben Sie bitte ein gültiges Fälligkeitsdatum ein'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_ERROR','Die Zahlung kann nicht verarbeitet werden, weil die grundlegenden Anforderungen nicht erfüllt wurden.'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MINIMUM_AMOUNT_ERROR','Der Mindestbetrag sollte bei mindestens 20,00 EUR liegen, jedoch nicht mehr als 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_GUARANTEE_MAXIMUM_AMOUNT_ERROR','Der Maximalbetrag sollte größer sein als der Mindestbestellbetrag, jedoch nicht höher als 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_INVOICE_PUBLIC_TITLE', 'Kauf auf Rechnung '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Kauf auf Rechnung ':'')); diff --git a/lang/german/modules/payment/novalnet_paypal.php b/lang/german/modules/payment/novalnet_paypal.php new file mode 100644 index 0000000..91b7ea2 --- /dev/null +++ b/lang/german/modules/payment/novalnet_paypal.php @@ -0,0 +1,54 @@ +Um diese Option zu verwenden, müssen Sie die Option Billing Agreement (Zahlungsvereinbarung) in Ihrem PayPal-Konto aktiviert haben. Kontaktieren Sie dazu bitte Ihren Kundenbetreuer bei PayPal. '); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_NOTIFICATION_TO_MERCHANT',''); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_NEW_ACCOUNT', 'Mit neuen PayPal-Kontodetails fortfahren'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_GIVEN_ACCOUNT','Angegebene PayPal-Kontodetails'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANSACTION_TID','PayPal Transaktions-ID'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ORDER_TRANSACTION_TID','Novalnet Transaktions-ID'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ONE_CLICK','Kauf mit einem Klick'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_ZERO_AMOUNT','Transaktionen mit Betrag 0'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_PAYPAL_PUBLIC_TITLE', 'PayPal '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'PayPal':'')); diff --git a/lang/german/modules/payment/novalnet_prepayment.php b/lang/german/modules/payment/novalnet_prepayment.php new file mode 100644 index 0000000..cbec193 --- /dev/null +++ b/lang/german/modules/payment/novalnet_prepayment.php @@ -0,0 +1,50 @@ +Vorauskasse Konfiguration'); +define('MODULE_PAYMENT_NOVALNET_PREPAYMENT_PUBLIC_TITLE', 'Vorauskasse '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'Vorauskasse':'')); diff --git a/lang/german/modules/payment/novalnet_przelewy24.php b/lang/german/modules/payment/novalnet_przelewy24.php new file mode 100644 index 0000000..db88264 --- /dev/null +++ b/lang/german/modules/payment/novalnet_przelewy24.php @@ -0,0 +1,43 @@ +Bitte schließen Sie den Browser nach der erfolgreichen Zahlung nicht, bis Sie zum Shop zurückgeleitet wurden'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED_TITLE','Zugelassene Gebiete'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ALLOWED_DESC','Diese Zahlungsart wird nur für die aufgeführten Gebiete zugelassen. Geben Sie die Gebiete in folgendem Format ein, z.B. DE, AT, CH etc. Falls das Feld leer ist, sind alle Gebiete zugelassen.'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE_TITLE','Zahlungsart aktivieren'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENABLE_MODULE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE_TITLE','Testmodus aktivieren'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TEST_MODE_DESC','Die Zahlung wird im Testmodus durchgeführt, daher wird der Betrag für diese Transaktion nicht eingezogen'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT_TITLE','Mindestwarenwert (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_VISIBILITY_BY_AMOUNT_DESC','Geben Sie den Mindestwarenwert ein, von dem ab die Zahlungsart für den Kunden beim Checkout angezeigt wird'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO_TITLE','Benachrichtigung des Käufers'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ENDCUSTOMER_INFO_DESC','Der eingegebene Text wird auf der Checkout-Seite angezeigt'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER_TITLE','Geben Sie eine Sortierreihenfolge an'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_SORT_ORDER_DESC','Diese Zahlungsart wird unter anderen Zahlungsarten (in aufsteigender Richtung) anhand der angegebenen Nummer für die Sortierung eingeordnet'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS_TITLE','Bestellstatus der ausstehenden Zahlung'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PENDING_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS_TITLE','Abschluss-Status der Bestellung'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_ORDER_STATUS_DESC',''); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE_TITLE','Zahlungsgebiet'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PAYMENT_ZONE_DESC','Diese Zahlungsart wird für die angegebenen Gebiete angezeigt'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1_TITLE','1. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE1_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2_TITLE','2. Referenz zur Transaktion'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_TRANS_REFERENCE2_DESC','Diese Referenz wird auf Ihrem Kontoauszug erscheinen'); +define('MODULE_PAYMENT_NOVALNET_PRZELEWY24_PUBLIC_TITLE', 'Przelewy24 '.(((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True') ? 'przelewy24':'')); diff --git a/lang/german/modules/payment/novalnet_sepa.php b/lang/german/modules/payment/novalnet_sepa.php new file mode 100644 index 0000000..2a74112 --- /dev/null +++ b/lang/german/modules/payment/novalnet_sepa.php @@ -0,0 +1,77 @@ + Hiermit erteile ich das SEPA-Lastschriftmandat und bestätige, dass die angegebene IBAN und BIC korrekt sind.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE_TITLE','Abstand (in Tagen) bis zum SEPA-Einzugsdatum'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PAYMENT_DUE_DATE_DESC','Geben Sie die Anzahl der Tage ein, nach denen die Zahlung verarbeitet werden soll (muss größer als 6 Tage sein).'); +define('MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL_TITLE','Automatisches Eintragen aktivieren'); +define('MODULE_PAYMENT_NOVALNET_SEPA_AUTO_FILL_DESC','Die Zahlungsdetails werden automatisch während des Checkout-Vorgangs in das Zahlungsformular eingetragen.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_TITLE','

Einstellungen für die Zahlungsgarantie

Grundanforderungen für die Zahlungsgarantie

Zugelassene Staaten: AT, DE, CH
Zugelassene Währung: EUR
Mindestbetrag der Bestellung >= 20,00 EUR
Maximalbetrag der Bestellung <= 5.000,00 EUR
Mindestalter des Endkunden >= 18 Jahre
Rechnungsadresse und Lieferadresse müssen übereinstimmen
Geschenkgutscheine / Coupons sind nicht erlaubt

Zahlungsgarantie aktivieren'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_DESC',''); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT_TITLE','Mindestbestellbetrag (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_ORDER_AMOUNT_DESC','Diese Einstellung wird den Standardwert für den Mindestbestellbetrag überschreiben. Beachten Sie, dass der Betrag im Bereich von 20,00 EUR – 5.000,00 EUR liegen muss.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT_TITLE','Maximaler Bestellbetrag (in der kleinsten Währungseinheit, z.B. 100 Cent = entsprechen 1.00 EUR)'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_ORDER_AMOUNT_DESC','Diese Einstellung wird den Standardwert für den Maximal-Bestellbetrag überschreiben. Beachten Sie, dass dieser Betrag größer als der Mindestbestellbetrag sein sollte, jedoch nicht höher als 5.000,00 EUR.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_FORCE_TITLE','Zahlung ohne Zahlungsgarantie erzwingen'); +define('MODULE_PAYMENT_NOVALNET_SEPA_FORCE_DESC','Falls die Zahlungsgarantie aktiviert ist (wahr), die oben genannten Anforderungen jedoch nicht erfüllt werden, soll die Zahlung ohne Zahlungsgarantie verarbeitet werden.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_BLOCK_TITLE','SEPA Konfiguration'); +define('MODULE_PAYMENT_NOVALNET_SEPA_DUE_DATE_ERROR','SEPA Fälligkeitsdatum Ungültiger'); +define('MODULE_PAYMENT_NOVALNET_SEPA_MANDATE_CONFIRM_ERROR','Akzeptieren Sie bitte das SEPA-Lastschriftmandat'); +define('MODULE_PAYMENT_NOVALNET_SEPA_SELECT_COUNTRY','Wählen Sie bitte ein Land aus'); +define('MODULE_PAYMENT_NOVALNET_SELECT_PAYMENT_METHOD','Wählen Sie bitte die Zahlungsart aus'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_ERROR','Die Zahlung kann nicht verarbeitet werden, weil die grundlegenden Anforderungen nicht erfüllt wurden.'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MINIMUM_AMOUNT_ERROR','Der Mindestbetrag sollte bei mindestens 20,00 EUR liegen, jedoch nicht mehr als 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_GUARANTEE_MAXIMUM_AMOUNT_ERROR','Der Maximalbetrag sollte größer sein als der Mindestbestellbetrag, jedoch nicht höher als 5.000,00 EUR'); +define('MODULE_PAYMENT_NOVALNET_SEPA_PUBLIC_TITLE', 'Lastschrift SEPA '. (((!defined('MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY')) || MODULE_PAYMENT_NOVALNET_PAYMENT_LOGO_DISPLAY == 'True')?'Lastschrift SEPA':'')); diff --git a/novalnet_subscription.php b/novalnet_subscription.php new file mode 100644 index 0000000..8022753 --- /dev/null +++ b/novalnet_subscription.php @@ -0,0 +1,126 @@ + $datas['vendor'], + 'product' => $datas['product'], + 'key' => $datas['payment_id'], + 'tariff' => $datas['tariff_id'], + 'auth_code' => $datas['auth_code'], + 'cancel_sub' => '1', + 'tid' => $parent_tid, + 'cancel_reason' => $request['novalnet_subscribe_termination_reason']),$order_id); + xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'page=1&order_id=' . $order_id, 'SSL')); +} +/** + * Perform subscription cancellation + * + * @param array $subscription_params + * @param integer $order_id + * @return string + */ + function doCancelSubscription($subscription_params,$order_id) { + // Send the request to Novalnet server + $response = NovalnetHelper::doPaymentCurlCall('https://payport.novalnet.de/paygate.jsp', $subscription_params); + parse_str($response, $data); + $params['gateway_status'] = $data['tid_status']; + if ($data['status'] == 100) { // Success of subscription cancellation + // Update gateway status in Novalnet table + xtc_db_perform('novalnet_transaction_detail', $params, "update", "tid=" . $subscription_params['tid']); + $params = array( + 'termination_reason' => $subscription_params['cancel_reason'], + 'termination_at' => date('Y-m-d H:i:s') + ); + // Update subscription termination details in Novalnet subscription table + xtc_db_perform('novalnet_subscription_detail', $params, "update", "tid=" . $subscription_params['tid']); + $message = PHP_EOL . MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_MESSAGE . $subscription_params['cancel_reason'] . PHP_EOL; + $subscription_orders = xtc_db_query("SELECT order_no FROM novalnet_subscription_detail WHERE tid='". xtc_db_input($subscription_params['tid']) ."' "); + // Update the order status in shop + while ($row = xtc_db_fetch_array($subscription_orders)) { + xtc_db_perform(TABLE_ORDERS, array( + 'orders_status' => MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL, + ), 'update', 'orders_id="' . $row['order_no'] . '"'); + + xtc_db_query("INSERT INTO " . TABLE_ORDERS_STATUS_HISTORY . " SET orders_id =".(int)$row['order_no'].",orders_status_id = '".MODULE_PAYMENT_NOVALNET_SUBSCRIPTION_CANCEL."', date_added = NOW(), customer_notified = '1', comments = '".$message."'"); + } + } else { // Failure of subscription cancellation + xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'page=1&order_id=' . $order_id, 'SSL')); + } + } +/** + * To process Novalnet subscription cancel process + * + * @param integer $order_id + * return void + */ +function displaySubscriptionForm($order_id) +{ + $order_id = (int)$order_id; + $transaction_info = xtc_db_fetch_array(xtc_db_query("SELECT gateway_status FROM novalnet_transaction_detail WHERE order_no=" . $order_id)); + $subscription_info = xtc_db_fetch_array(xtc_db_query("SELECT subs_id, termination_reason FROM novalnet_subscription_detail WHERE order_no=" . $order_id)); + $subscripton_option = ''; + if (!empty($transaction_info) && $transaction_info['gateway_status'] != 103 && !empty($subscription_info) && !empty($subscription_info['subs_id']) && empty($subscription_info['termination_reason'])) { + $subs_termination_reason = array( + MODULE_PAYMENT_NOVALNET_SUBS_REASON_1, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_2, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_3, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_4, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_5, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_6, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_7, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_8, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_9, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_10, + MODULE_PAYMENT_NOVALNET_SUBS_REASON_11 + ); + $subscripton_option = "

" . MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_TITLE . ":


"; + $subscripton_option .= "

" . MODULE_PAYMENT_NOVALNET_SUBS_SELECT_REASON . "

". + xtc_draw_form('novalnet_subscriptionstop',DIR_WS_CATALOG . "novalnet_subscription.php"). + xtc_draw_hidden_field('order_id', $order_id, 'id="order_id"'). + xtc_draw_hidden_field('nn_sub_cancel', MODULE_PAYMENT_NOVALNET_PAYMENT_CANCEL_SUBSCRIPTION, 'id="nn_sub_cancel"'). + xtc_draw_hidden_field('nn_subs_error', MODULE_PAYMENT_NOVALNET_SUBS_CANCEL_REASON_TITLE, 'id="nn_subs_error"'). + xtc_draw_hidden_field('current_url', $_SERVER['REQUEST_URI'], 'id="current_url"')." +   "; + } + return $subscripton_option; +}