Linux mail.vriendennsm.nl 6.1.0-51-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.177-1 (2026-07-16) x86_64
Apache/2.4.68 (Debian)
Server IP : 217.154.75.17 & Your IP : 216.73.216.195
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
vnsm /
plugins /
j2store /
payment_paynl /
Delete
Unzip
Name
Size
Permission
Date
Action
library
[ DIR ]
drwxr-xr-x
2025-02-08 22:29
payment_paynl
[ DIR ]
drwxr-xr-x
2025-02-08 22:29
index.html
98
B
-rwxr-xr-x
2019-11-20 18:26
payment_paynl.php
1.03
KB
-rwxr-xr-x
2019-11-20 18:26
payment_paynl.xml
3.46
KB
-rwxr-xr-x
2019-11-20 18:26
paynlv2.php
18.69
KB
-rwxr-xr-x
2019-11-20 18:26
paynlv3.php
16.74
KB
-rwxr-xr-x
2019-11-20 18:26
paynlv32.php
22.63
KB
-rwxr-xr-x
2019-11-20 18:26
Save
Rename
<?php /** * -------------------------------------------------------------------------------- * Payment Plugin - paynl * -------------------------------------------------------------------------------- * @package Joomla 2.5 - 3.x * @subpackage J2 Store * @author Alagesan, J2Store <support@j2store.org> * @copyright Copyright (c) 2015 J2Store . All rights reserved. * @license GNU GPL v3 or later * @link http://j2store.org * -------------------------------------------------------------------------------- * * */ defined('_JEXEC') or die('Restricted access'); require_once (JPATH_ADMINISTRATOR.'/components/com_j2store/library/plugins/payment.php'); //require_once (JPath::clean(dirname(__FILE__) . "/library/Transactions.php")); //require_once (JPath::clean(dirname(__FILE__) . "/library/Autoload.php")); require_once ( JPath::clean ( dirname ( __FILE__ ) . "/library/vendor/autoload.php" ) ); class plgJ2StorePayment_paynl extends J2StorePaymentPlugin { /** * @var $_element string Should always correspond with the plugin's filename, * forcing it to be unique */ var $_element = 'payment_paynl'; var $_isLog = false; private $service_id; private $apitoken; function __construct(& $subject, $config) { parent::__construct($subject, $config); $this->loadLanguage( '', JPATH_ADMINISTRATOR ); $this->apitoken = trim($this->_getParam('paynl_token')); $this->service_id = trim($this->_getParam('paynl_service_id')); $this->_isLog = $this->params->get('debug',0); } /** * Prepares variables and * Renders the form for collecting payment info * * @return unknown_type */ function _renderForm( $data ) { $vars = new JObject(); $vars->onselection_text = $this->params->get('onselection', ''); try { if(empty($this->apitoken) || empty($this->service_id)){ $vars->error = JText::_('J2STORE_PAYNL_ENTER_APITOKEN_AND_SERVICE_ID'); } \Paynl\Config::setApiToken($this->apitoken); \Paynl\Config::setServiceId($this->service_id); $paymentMethods = \Paynl\Paymentmethods::getList(); //$basePath = $paymentMethods['service']['basePath']; $paymentOptions = array(); foreach ($paymentMethods as $paymentOption) { $tmpPaymentOption = array(); $tmpPaymentOption['id'] = $paymentOption['id']; $tmpPaymentOption['name'] = $paymentOption['visibleName']; //$tmpPaymentOption['image'] = $basePath . $paymentOption['path'] . $paymentOption['img']; if (!empty($paymentOption['paymentOptionSubList'])) { $tmpPaymentOption['subList'] = array(); foreach ($paymentOption['paymentOptionSubList'] as $subItem) { $tmpPaymentOption['subList'][$subItem['id']] = array( 'id' => $subItem['id'], 'name' => $subItem['visibleName'], // 'img' => $basePath . $subItem['path'] . $subItem['img'], ); } } $paymentOptions[$tmpPaymentOption['id']] = $tmpPaymentOption; } $vars->paymentOptions = $paymentOptions;//Pay_Helper::sortPaymentOptions($paymentOptions); }catch (\Paynl\Error\Error $e) { $vars->error = $e->getMessage(); } $html = $this->_getLayout('form', $vars); return $html; } function _verifyForm( $submitted_values ) { $object = new JObject(); $object->error = false; $object->message = ''; $user = JFactory::getUser(); foreach ($submitted_values as $key=>$value) { switch ($key) { case "optionId": if (!isset($submitted_values[$key]) || !JString::strlen($submitted_values[$key])) { $object->error = true; $object->message .= "<li>".JText::_( "J2STORE_PAYNL_MESSAGE_PAYMENT_OPTION_REQUIRED" )."</li>"; } break; default: break; } } return $object; } /** * @param $data array form post data * @return string HTML to display */ function _prePayment( $data ) { $app = JFactory::getApplication(); $session = JFactory::getSession(); $currency = J2Store::currency(); $params = J2Store::config(); // prepare the payment form $vars = new JObject(); $vars->onbeforepayment_text = $this->params->get('onbeforepayment', ''); $vars->display_name = $this->params->get('display_name', 'PLG_J2STORE_PAYMENT_PAYNL'); $vars->button_text = $this->params->get('button_text', 'J2STORE_PLACE_ORDER'); //finish url $notify_url = JURI::root()."index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=".$this->_element."&paction=process&tmpl=component"; $returnUrl = JURI::root()."index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=".$this->_element."&paction=display"; $order = F0FTable::getInstance ( 'Order', 'J2StoreTable' )->getClone (); $order->load ( array ( 'order_id' => $data ['order_id'] ) ); $currency_values = $this->getCurrency ( $order,false ); $currency_code = $currency_values['currency_code']; try { $amount = $currency->format($order->order_total, $currency_values['currency_code'], $currency_values['currency_value'], false); $amount = round($amount,2) * 100; $items = $order->get_line_items($params->get('checkout_price_display_options', 1)); $itemamt = 0; // add item details $OrderItems = array (); $i = 1; foreach ( $items as $item ) { $desc = $item['name']; if (count($item['options'])) { foreach ($item['options'] as $option) { $desc .= ' | ' .$option['name']. ':' .$option['value']; } } $desc = str_replace("'", '', $desc); $price = round($currency->format ($item['amount'], $currency_values ['currency_code'], $currency_values ['currency_value'], $currency_values ['convert'] ),2); $itemamt += round($currency->format( ($price*$item['quantity']), $currency_values ['currency_code'], $currency_values ['currency_value'], $currency_values ['convert'] ),2); if(isset($item['item_number']) && $item['item_number'] == 'shipping' ){ $orderItem = array ( 'name' => $desc, 'id' => $i, 'qty' => $item['quantity'], 'price' => $price, 'tax' => 0, 'type' => \Paynl\Transaction::PRODUCT_TYPE_SHIPPING ); }else{ $orderItem = array ( 'name' => $desc, 'id' => $i, 'qty' => $item['quantity'], 'price' => $price, 'tax' => 0, 'type' => \Paynl\Transaction::PRODUCT_TYPE_ARTICLE ); } array_push ( $OrderItems, $orderItem ); $i++; } //if excluding tax, then we should be sending the tax for the cart as an item as well if($params->get('checkout_price_display_options', 1) == 0 ) { if($order->order_tax > 0) { $tax = round($currency->format ($order->order_tax, $currency_values ['currency_code'], $currency_values ['currency_value'], $currency_values ['convert'] ),2); $orderItem = array ( 'name' => JText::_('J2STORE_CART_TAX'), 'id' => $i, 'qty' => 1, 'price' => $tax, 'tax' => 0 ) ; array_push ( $OrderItems, $orderItem ); $i++; $itemamt += $tax; } //add discount $discount_amount_cart = round($currency->format ( $order->get_total_discount($params->get('checkout_price_display_options', 1)), $currency_values ['currency_code'], $currency_values ['currency_value'], $currency_values ['convert'] ),2); if ($discount_amount_cart > 0) { $orderItem = array ( 'name' => JText::_('J2STORE_CART_DISCOUNT'), 'id' => $i, 'qty' => 1, 'price' => - $discount_amount_cart, 'tax' => 0, 'type' => \Paynl\Transaction::PRODUCT_TYPE_DISCOUNT ) ; array_push ( $OrderItems, $orderItem ); $i++; $itemamt -= $discount_amount_cart; } } $amount = round($currency->format ( $order->order_total, $currency_values ['currency_code'], $currency_values ['currency_value'], $currency_values ['convert'] ),2); $description = JText::_ ( "J2STORE_PAYPALPRO_ORDER_DESCRIPTION" ) . ": " . $order->order_id; //get invoice number //$invoice_number = $order->getInvoiceNumber (); if(round($amount,2) != round($itemamt,2)) { //line item totals do not match. Send the order as the line item $OrderItems = array (); $orderItem = array ( 'name' => $description, 'id' => 1, 'qty' => 1, 'price' => $amount, 'tax' => 0, 'type' => \Paynl\Transaction::PRODUCT_TYPE_ARTICLE ) ; array_push ( $OrderItems, $orderItem ); $itemamt = $amount; } // get the order info from order info table $orderinfo = $order->getOrderInformation(); $billing_phone = (! empty ( $orderinfo->billing_phone_1 )) ? $orderinfo->billing_phone_1 : $orderinfo->billing_phone_2; $billing_country = $this->getCountryById($orderinfo->billing_country_id ); $tag = JFactory::getLanguage()->getTag(); $tag = substr($tag,0,2); if(!in_array($tag,array('en','nl','de','fr','es','it'))){ $tag = 'EN'; }else{ $tag = strtoupper($tag); } $payment_params = array( // required 'amount' => $amount, 'returnUrl' => $returnUrl,//dirname(Paynl\Helper::getBaseUrl()) . '/return.php', // optional 'exchangeUrl' => $notify_url,//dirname(Paynl\Helper::getBaseUrl()) . '/exchange.php', //'paymentMethod' => isset($data['optionId']) && !empty($data['optionId']) ? , 'currency' => $currency_code, //'expireDate' => new DateTime('2016-04-01'), // 'bank' => 1, 'description' => $order->order_id, //'testmode' => 0, 'extra1' => $order->order_id, //'extra2' => 'ext2', //'extra3' => 'ext3', 'ipaddress' => \Paynl\Helper::getIp(), 'invoiceDate' => new DateTime('now'), //'deliveryDate' => new DateTime('2016-06-06'), // in case of tickets for an event, use the event date here 'products' => $OrderItems, 'language' => $tag, 'enduser' => array( 'initials' => $orderinfo->billing_first_name, 'lastName' => $orderinfo->billing_last_name, //'gender' => '', //'birthDate' => '14-05-1999', 'phoneNumber' => $billing_phone, 'emailAddress' => $order->user_email, ), 'address' => array( 'streetName' => $orderinfo->billing_address_1." ".$orderinfo->billing_address_2, 'houseNumber' => '', 'zipCode' => $orderinfo->billing_zip, 'city' => $orderinfo->billing_city, 'country' => $billing_country->country_isocode_2, ), 'invoiceAddress' => array( 'initials' => $orderinfo->billing_first_name, 'lastName' => $orderinfo->billing_last_name, 'streetName' => $orderinfo->billing_address_1." ".$orderinfo->billing_address_2, 'houseNumber' => '', 'zipCode' => $orderinfo->billing_zip, 'city' => $orderinfo->billing_city, 'country' => $billing_country->country_isocode_2, ), ); if(isset($data['optionId']) && !empty($data['optionId'])){ $payment_params['paymentMethod'] = $data['optionId']; } $mode = $this->params->get('sandbox',0); if($mode){ $payment_params['testmode'] = 1; }else{ $payment_params['testmode'] = 0; } \Paynl\Config::setApiToken($this->apitoken); \Paynl\Config::setServiceId($this->service_id); $result = \Paynl\Transaction::start($payment_params); $transactionId = $result->getTransactionId(); $payment_url = $result->getRedirectUrl(); if(isset($transactionId) && isset($payment_url) && !empty($payment_url) && !empty($transactionId)){ $vars->payment_url = $payment_url; $order->transaction_id = $transactionId; $order->update_status ( 4 ); //now store $order->store(); } }catch (\Paynl\Error\Error $e) { $vars->error = $e->getMessage(); } $html = $this->_getLayout('prepayment', $vars); return $html; } /** * Processes the payment form * and returns HTML to be displayed to the user * generally with a success/failed message * * @param $data array form post data * @return string HTML to display */ function _postPayment( $data ) { // Process the payment $vars = new JObject(); $app = JFactory::getApplication(); $paction = $app->input->getString( 'paction' ); switch ($paction) { case "display": $message = $this->_process(); if($message === 'TRUE'){ $vars->message = JText::_($this->params->get('onafterpayment', '')); }else{ $vars->message = $message; } $html = $this->_getLayout('message', $vars); $html .= $this->_displayArticle(); break; case 'process': $message = $this->_process(); if($message === 'TRUE'){ $html = 'TRUE| PAID'; }else{ $message = preg_replace("/[^A-Za-z0-9 ]/", '', $message); $html = 'TRUE| '.$message; } //$html = $this->_getLayout('message', $vars); echo $html; // TODO Remove this $app->close(); break; default: $vars->message = $this->params->get('onerrorpayment', ''); $html = $this->_getLayout('message', $vars); break; } return $html; } /** * Processes the payment * * This method process only real time (simple) payments * * @return string * @access protected */ function _process() { $app = JFactory::getApplication(); //initialise errors array $errors = array(); $return = ''; $post = $app->input->getArray($_REQUEST); $post['transaction_details'] = $this->_getFormattedTransactionDetails($post); $this->_log($post['transaction_details']); try{ \Paynl\Config::setApiToken($this->apitoken); \Paynl\Config::setServiceId($this->service_id); $paction = $app->input->getString( 'paction' ); if($paction == 'display'){ $transaction = \Paynl\Transaction::getForReturn(); }elseif ($paction == 'process'){ $transaction = \Paynl\Transaction::getForExchange(); } if(!is_object ( $transaction )){ $errors[] = JText::_('J2STORE_PAYNL_INVALID_RESPONSE'); } //get the order id $order_id = $transaction->getExtra1 (); if($order_id > 0 && empty( $errors )) { $order = F0FTable::getInstance ( 'Order', 'J2StoreTable' )->getClone (); $order->load(array( 'order_id' => $order_id )); if(!empty( $order->order_id )&& $order->j2store_order_id > 0 && $order->order_id == $order_id) { $order->transaction_status = $post['paymentDetails']['stateName']; $order->transaction_details = $post['transaction_details']; if($transaction->isPaid () || $transaction->isAuthorized()){ $return = 'TRUE'; //COMPLETED $order->payment_complete (); //clear cart $order->empty_cart(); }elseif ($transaction->isPending ()){ $return = 'TRUE'; $order->update_status ( 4 ); }elseif ($transaction->isCancelled ()){ $order->update_status ( 6 ); return JText::_($this->params->get('oncancelpayment', '')); }else{ $order->update_status ( 3 ); } if(!$order->store()) { $errors[]=JText::_('J2STORE_PAYNL_ERROR_SAVING_DATA'); } }else { $errors[]=JText::_('J2STORE_PAYNL_MESSAGE_ORDER_DOES_NOT_EXIST'); } } }catch (\Paynl\Error\Error $e) { $errors[] = $e->getMessage(); }catch(\Exception $e){ $errors[] = $e->getMessage(); } //if errors, send admin an email if (count($errors)) { $error = implode("\n", $errors); // send an emails to site's administrators with error messages $config = JFactory::getConfig (); $sitename = $config->get('sitename'); //send error notification to the administrators $subject = JText::sprintf('J2STORE_PAYNL_EMAIL_PAYMENT_NOT_VALIDATED_SUBJECT', $sitename); $body = JText::sprintf('J2STORE_PAYNL_EMAIL_PAYMENT_FAILED_BODY', 'Administrator', $sitename, JURI::root(), $error, $post['transaction_details']); $receivers = $this->_getAdmins(); // send an emails to site's administrators with error messages foreach ($receivers as $receiver){ J2Store::email()->sendErrorEmails($receiver->email, $subject, $body); } return $error; } //all went well. return $return;//JText::_($this->params->get('onafterpayment', '')); } /** * Simple logger * * @param string $text * @param string $type * @return void */ function _log($text, $type = 'message') { if ($this->_isLog) { $file = JPATH_ROOT . "/cache/{$this->_element}.txt"; $date = JFactory::getDate(); $f = fopen($file, 'a'); fwrite($f, "\n\n" . $date->format('Y-m-d H:M:S')); fwrite($f, "\n" . $type . ': ' . $text); fclose($f); } } /** * Formatts the payment data for storing * * @param array $data * @return string */ private function _getFormattedTransactionDetails($data) { return json_encode ( $data ); } /** * Gets admins data * * @return array|boolean * @access protected */ function _getAdmins() { $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('u.name,u.email'); $query->from('#__users AS u'); $query->join('LEFT', '#__user_usergroup_map AS ug ON u.id=ug.user_id'); $query->where('u.sendEmail = 1'); $query->where('ug.group_id = 8'); $db->setQuery($query); $admins = $db->loadObjectList(); if ($error = $db->getErrorMsg()) { JError::raiseError(500, $error); return false; } return $admins; } function getCurrency($order, $convert=false) { $results = array(); $convert = false; $currencyObject = J2Store::currency (); $currency_code = $order->currency_code; $currency_value = $order->currency_value; //accepted currencies $currencies = $this->getAcceptedCurrency(); if(!in_array($order->currency_code, $currencies)) { $default_currency = 'EUR'; if($currencyObject->has($default_currency)) { $currencyObject->set($default_currency); $currency_code = $default_currency; $currency_value = $currencyObject->getValue($default_currency); $convert = true; } } $results['currency_code'] = $currency_code; $results['currency_value'] = $currency_value; $results['convert'] = $convert; return $results; } function getAcceptedCurrency() { return array ( 'EUR' ); } /** * Gets a value of the plugin parameter * * @param string $name * @param string $default * @return string * @access protected */ function _getParam($name, $default = '') { $sandbox_param = "sandbox_$name"; $sb_value = $this->params->get($sandbox_param); if ($this->params->get('sandbox') && !empty($sb_value)) { $param = $this->params->get($sandbox_param, $default); } else { $param = $this->params->get($name, $default); } return $param; } }