From 1d6274d5c451196ed142d2631f36ba854a467f88 Mon Sep 17 00:00:00 2001 From: mateuszpy Date: Thu, 12 Nov 2015 15:50:33 +0100 Subject: [PATCH] v1.1 -visual changes in settings --- README.md | 26 +++++++++++------- dp_logo_alpha_175_50.png | Bin 0 -> 3289 bytes .../en-GB.plg_j2store_payment_dotpay.ini | 9 +++--- .../en-GB.plg_j2store_payment_dotpay.sys.ini | 3 +- .../pl-PL.plg_j2store_payment_dotpay.ini | 9 +++--- .../pl-PL.plg_j2store_payment_dotpay.sys.ini | 3 +- payment_dotpay.php | 25 +++-------------- payment_dotpay.xml | 11 +++++--- validation/testid.php | 1 + 9 files changed, 42 insertions(+), 45 deletions(-) create mode 100644 dp_logo_alpha_175_50.png diff --git a/README.md b/README.md index bc0112c..e206255 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,21 @@ -PLUGIN Dotpay dla sklepu J2Store -=============================== +J2Store Dotpay payment module +===================== -Testowane na: - - Joomla 3.4.3 - - J2Store 3.1.10 +*English version below* -UWAGI!! -====== +####Wtyczka dla Joomla dodająca bramkę płatności Dotpay#### -Jeśli transakcja przebiegnie poprawnie użytkownik zostanie przekierowany na pusty koszyk. +### Instrukcja: ### +1. Pobierz wtyczkę dotpay.zip (https://github.com/dotpay/j2store/releases/latest) +2. Zainstaluj wtyczkę poprzez instalator dodatków Joomla. +3. Aktywuj wtyczkę w zakładce dodatki i ją skonfiguruj. -Jeśli tranzakcja nie zostanie poprawnie zakończona użytkownik zostanie przekierowany na koszyk w celu ponownego dokończenia tranzakcji. -Działanie przekierowań jest wymuszone przez sklep J2Store. \ No newline at end of file +--------------------------------------- + +####Joomla plugin adding Dotpay payment gateway#### + +### Instructions: ### +1. Download the plugin dotpay.zip (https://github.com/dotpay/j2store/releases/latest) +2. Install plugin via Joomla extension installer +3. Activate the plugin in extensions tab and configure it. \ No newline at end of file diff --git a/dp_logo_alpha_175_50.png b/dp_logo_alpha_175_50.png new file mode 100644 index 0000000000000000000000000000000000000000..6b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l.dotpay.pl/', + 0 => 'https://ssl.dotpay.pl/t2/', 1 => 'https://ssl.dotpay.pl/test_payment/' ); @@ -113,14 +113,10 @@ public function _prePayment( $data ) { $vars = new JObject(); $info = $this->getOrderInformation($data); - $order = $this->getOrderByPayment($data['orderpayment_id']); - $currency_values= $this->getCurrency($order); - - //Needed for Dotpay $vars->id = $this->params->get('accountId'); - $vars->amount = $this->getAmount($order); - $vars->currency = $currency_values['currency_code']; + $vars->amount = $data['orderpayment_amount']; + $vars->currency = $data['order']->currency_code; $vars->description = JText::_('J2STORE_PLUGIN_DOTPAY_ORDER') . $data['order_id']; $vars->lang = $this->getLanguage(); $vars->api_version = $this->_default['api_version']; @@ -231,11 +227,6 @@ private function setCompleteStatus($orderId) $this->save($order); } - private function getAmount($order) - { - $currency_values= $this->getCurrency($order); - return J2Store::currency()->format($order->order_total, $currency_values['currency_code'], $currency_values['currency_value'], false); - } /** * This method change order status. Status is defined as $order_state_id @@ -284,14 +275,6 @@ private function getOrder($orderId) return $order; } - private function getOrderByPayment($paymentId) - { - F0FTable::addIncludePath ( JPATH_ADMINISTRATOR . '/components/com_j2store/tables' ); - $order = F0FTable::getInstance ( 'Order', 'J2StoreTable' ); - $order->load($paymentId); - return $order; - } - /** * Based on status set error or ok message displaying to customer * @@ -340,7 +323,7 @@ private function getOrderInformation( $data ) { private function getPrice($order_id) { $order = $this->getOrder($order_id); if($order){ - return $this->getAmount($order); + return $order->order_total; } return 0; } diff --git a/payment_dotpay.xml b/payment_dotpay.xml index d358959..6d16d61 100644 --- a/payment_dotpay.xml +++ b/payment_dotpay.xml @@ -1,11 +1,11 @@ - Dotpay - 1.0 - August 2015 + Dotpay Payment for j2store + 1.1 + 12.10.2015 Dotpay galaspiotrek@gmail.com - dotpay + http://www.dotpay.pl/ Dotpay GNU General Public License v2 or later J2STORE_DOTPAY_PAYMENT_DESC @@ -23,6 +23,9 @@ languages/en-GB.plg_j2store_payment_dotpay.sys.ini languages/pl-PL.plg_j2store_payment_dotpay.sys.ini + + dp_logo_alpha_175_50.png +
diff --git a/validation/testid.php b/validation/testid.php index b03e9f8..e20c734 100644 --- a/validation/testid.php +++ b/validation/testid.php @@ -5,5 +5,6 @@ class JFormRuleTestid extends JFormRule public function test(&$element, $value, $group = null, &$input = null, &$form = null) { return preg_match('/^[0-9]{6}$/', $value) == 1; + } } \ No newline at end of file