Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
-visual changes in settings
  • Loading branch information
mateuszpy committed Nov 12, 2015
1 parent 138e5cd commit 1d6274d
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 45 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
---------------------------------------

####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.
Binary file added dp_logo_alpha_175_50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions languages/en-GB.plg_j2store_payment_dotpay.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
J2STORE_DOTPAY_PAYMENT_DESC="Dotpay payment gateway for J2Store."
J2STORE_DOTPAY_PAYMENT_DESC="<div style='text-align:left;font-size:14px;font-weight:normal'><img src='../media/j2store/images/payment/dotpay/dp_logo_alpha_175_50.png' />
<br/><br/><br /><p class='dotpay_rejestracja'><a href='https://ssl.dotpay.pl/s2/login/registration/?affilate_id=j2store' target='_blank' class='btn btn-primary btn-large' title='Register your account in Dotpay.pl'><span class='icon-new icon-white'></span> Register your account in Dotpay.pl </a></p><br/>This module will allow you to use Dotpay payment methods for 'j2Store'.</b><br />To configure the plugin its necessary to enter ID and PIN from Dotpay panel.</b></div><br/><b><u>CONFIGURATION MODULE:</u></b><br /><br />"

;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."

Expand Down
3 changes: 2 additions & 1 deletion languages/en-GB.plg_j2store_payment_dotpay.sys.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
J2STORE_DOTPAY_PAYMENT_DESC="Dotpay payment gateway for J2Store."
J2STORE_DOTPAY_PAYMENT_DESC="<div style='text-align:left;font-size:14px;font-weight:normal'><img src='../media/j2store/images/payment/dotpay/dp_logo_alpha_175_50.png' />
<br/><br/><b>This module will allow you to use Dotpay payment methods for VirtueMart.</b><br />To configure the plugin its necessary to enter ID and PIN from Dotpay panel.</b></div><br/>"
9 changes: 5 additions & 4 deletions languages/pl-PL.plg_j2store_payment_dotpay.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
J2STORE_DOTPAY_PAYMENT_DESC="System płatności dla J2Store"
J2STORE_DOTPAY_PAYMENT_DESC="<div style='text-align:left;font-size:14px;font-weight:normal'><img src='../media/j2store/images/payment/dotpay/dp_logo_alpha_175_50.png' />
<br/><br/><br /><p class='dotpay_rejestracja'><a href='https://ssl.dotpay.pl/s2/login/registration/?affilate_id=j2store' target='_blank' class='btn btn-primary btn-large' title='Zarejestruj konto w Dotpay.pl'><span class='icon-new icon-white'></span> Zarejestruj konto w Dotpay.pl </a></p><br/><b>Ten moduł pozwoli Ci na wykorzystanie metody płatności Dotpay w komponencie 'J2Store'.</b><br />Niezbędne czynności do konfiguracji wtyczki to przepisanie numeru ID oraz PIN z panelu Dotpay.</b></div><br/><b><u>KONFIGURACJA WTYCZKI:</u></b><br /><br />"

;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."

Expand Down
3 changes: 2 additions & 1 deletion languages/pl-PL.plg_j2store_payment_dotpay.sys.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
J2STORE_DOTPAY_PAYMENT_DESC="System płatności dla J2Store"
J2STORE_DOTPAY_PAYMENT_DESC="<div style='text-align:left;font-size:14px;font-weight:normal'><img src='../media/j2store/images/payment/dotpay/dp_logo_alpha_175_50.png' />
<br/><br/><b>Ten moduł pozwoli Ci na wykorzystanie metody płatności Dotpay w komponencie 'J2Store'.</b><br />Niezbędne czynności do konfiguracji wtyczki to przepisanie numeru ID oraz PIN z panelu Dotpay.</b></div>"
25 changes: 4 additions & 21 deletions payment_dotpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
);

Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
}
Expand Down
11 changes: 7 additions & 4 deletions payment_dotpay.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="j2store" method="upgrade">
<name>Dotpay</name>
<version>1.0</version>
<creationDate>August 2015</creationDate>
<name>Dotpay Payment for j2store</name>
<version>1.1</version>
<creationDate>12.10.2015</creationDate>
<author>Dotpay</author>
<authorEmail>galaspiotrek@gmail.com</authorEmail>
<authorUrl>dotpay</authorUrl>
<authorUrl>http://www.dotpay.pl/</authorUrl>
<copyright>Dotpay</copyright>
<license>GNU General Public License v2 or later</license>
<description>J2STORE_DOTPAY_PAYMENT_DESC</description>
Expand All @@ -23,6 +23,9 @@
<language tag="en-GB">languages/en-GB.plg_j2store_payment_dotpay.sys.ini</language>
<language tag="pl-PL">languages/pl-PL.plg_j2store_payment_dotpay.sys.ini</language>
</languages>
<media folder="/" destination="j2store/images/payment/dotpay">
<filename>dp_logo_alpha_175_50.png</filename>
</media>
<config>
<fields name="params">
<fieldset name="basic" addrulepath="plugins/j2store/payment_dotpay/validation">
Expand Down
1 change: 1 addition & 0 deletions validation/testid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
}

0 comments on commit 1d6274d

Please sign in to comment.