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 0000000..6b5d4b3 Binary files /dev/null and b/dp_logo_alpha_175_50.png differ diff --git a/languages/en-GB.plg_j2store_payment_dotpay.ini b/languages/en-GB.plg_j2store_payment_dotpay.ini index 66c7c4a..eaccc4b 100644 --- a/languages/en-GB.plg_j2store_payment_dotpay.ini +++ b/languages/en-GB.plg_j2store_payment_dotpay.ini @@ -1,12 +1,13 @@ -J2STORE_DOTPAY_PAYMENT_DESC="Dotpay payment gateway for J2Store." +J2STORE_DOTPAY_PAYMENT_DESC="
+


Register your account in Dotpay.pl


This module will allow you to use Dotpay payment methods for 'j2Store'.
To configure the plugin its necessary to enter ID and PIN from Dotpay panel.

CONFIGURATION MODULE:

" ;PARAMS J2STORE_PLUGIN_DOTPAY_ACCOUNTID_LABEL="Account ID" J2STORE_PLUGIN_DOTPAY_ACCOUNTID_DESC="Account ID for Dotpay payments" -J2STORE_PLUGIN_DOTPAY_TOKEN_LABEL="Token" -J2STORE_PLUGIN_DOTPAY_TOKEN_DESC="Token for Dotpay payments" +J2STORE_PLUGIN_DOTPAY_TOKEN_LABEL="PIN" +J2STORE_PLUGIN_DOTPAY_TOKEN_DESC="PIN must be the same as in Dotpay user panel" J2STORE_PLUGIN_DOTPAY_SANDBOX_LABEL="Sandbox" -J2STORE_PLUGIN_DOTPAY_SANDBOX_DESC="Change from production to testing envairment" +J2STORE_PLUGIN_DOTPAY_SANDBOX_DESC="Change from production to testing envairment. The test account is another account of production!" J2STORE_PLUGIN_DOTPAY_SSL_LABEL="Store use HTTPS." J2STORE_PLUGIN_DOTPAY_SSL_DESC="Mark yes, if store use SSL." diff --git a/languages/en-GB.plg_j2store_payment_dotpay.sys.ini b/languages/en-GB.plg_j2store_payment_dotpay.sys.ini index e2156d9..d41b065 100644 --- a/languages/en-GB.plg_j2store_payment_dotpay.sys.ini +++ b/languages/en-GB.plg_j2store_payment_dotpay.sys.ini @@ -1 +1,2 @@ -J2STORE_DOTPAY_PAYMENT_DESC="Dotpay payment gateway for J2Store." \ No newline at end of file +J2STORE_DOTPAY_PAYMENT_DESC="
+

This module will allow you to use Dotpay payment methods for VirtueMart.
To configure the plugin its necessary to enter ID and PIN from Dotpay panel.

" \ No newline at end of file diff --git a/languages/pl-PL.plg_j2store_payment_dotpay.ini b/languages/pl-PL.plg_j2store_payment_dotpay.ini index 2dde0b2..c650f3c 100644 --- a/languages/pl-PL.plg_j2store_payment_dotpay.ini +++ b/languages/pl-PL.plg_j2store_payment_dotpay.ini @@ -1,12 +1,13 @@ -J2STORE_DOTPAY_PAYMENT_DESC="System płatności dla J2Store" +J2STORE_DOTPAY_PAYMENT_DESC="
+


Zarejestruj konto w Dotpay.pl


Ten moduł pozwoli Ci na wykorzystanie metody płatności Dotpay w komponencie 'J2Store'.
Niezbędne czynności do konfiguracji wtyczki to przepisanie numeru ID oraz PIN z panelu Dotpay.

KONFIGURACJA WTYCZKI:

" ;PARAMS J2STORE_PLUGIN_DOTPAY_ACCOUNTID_LABEL="ID użytkownika" J2STORE_PLUGIN_DOTPAY_ACCOUNTID_DESC="ID użytkownika w systemie płatności Dotpay." -J2STORE_PLUGIN_DOTPAY_TOKEN_LABEL="Token" -J2STORE_PLUGIN_DOTPAY_TOKEN_DESC="Token dla systemu płatności Dotpay." +J2STORE_PLUGIN_DOTPAY_TOKEN_LABEL="PIN" +J2STORE_PLUGIN_DOTPAY_TOKEN_DESC="PIN można odnaleźć w panelu Dotpay po zalogowaniu klikając 'Ustawienia'" J2STORE_PLUGIN_DOTPAY_SANDBOX_LABEL="Środowisko testowe" -J2STORE_PLUGIN_DOTPAY_SANDBOX_DESC="Zmiana środowiska z produkcyjnego na testowe." +J2STORE_PLUGIN_DOTPAY_SANDBOX_DESC="Zmiana środowiska z produkcyjnego na testowe. Konto testowe jest odrębnym kontem od ptodukcyjnego!" J2STORE_PLUGIN_DOTPAY_SSL_LABEL="Sklep używa HTTPS." J2STORE_PLUGIN_DOTPAY_SSL_DESC="Zaznacz, jeśli sklep korzysta z bezpiecznego połączenia SSL." diff --git a/languages/pl-PL.plg_j2store_payment_dotpay.sys.ini b/languages/pl-PL.plg_j2store_payment_dotpay.sys.ini index b3cdf5b..ecfcfaf 100644 --- a/languages/pl-PL.plg_j2store_payment_dotpay.sys.ini +++ b/languages/pl-PL.plg_j2store_payment_dotpay.sys.ini @@ -1 +1,2 @@ -J2STORE_DOTPAY_PAYMENT_DESC="System płatności dla J2Store" +J2STORE_DOTPAY_PAYMENT_DESC="
+

Ten moduł pozwoli Ci na wykorzystanie metody płatności Dotpay w komponencie 'J2Store'.
Niezbędne czynności do konfiguracji wtyczki to przepisanie numeru ID oraz PIN z panelu Dotpay.
" diff --git a/payment_dotpay.php b/payment_dotpay.php index e803957..325b818 100644 --- a/payment_dotpay.php +++ b/payment_dotpay.php @@ -41,7 +41,7 @@ class plgJ2StorePayment_dotpay extends J2StorePaymentPlugin { * @var array */ protected $_url = array( - 0 => 'https://ssl.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