Skip to content

Commit

Permalink
PrestaShop 8
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelStrejcek committed Apr 21, 2023
1 parent bb555f6 commit e4f2588
Show file tree
Hide file tree
Showing 47 changed files with 84 additions and 63 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Module Pays for PrestaShop 1.7
# Module Pays for PrestaShop 8

Connection to the Pays payment gateway.

Expand All @@ -25,10 +25,10 @@ More information at https://www.BrainWeb.cz
## Further information

Further information (in Czech) is in the Instructions for Use:
[doc/Navod_k_pouziti_modulu_Pays_v1.3-PS1.7.pdf](doc/Navod_k_pouziti_modulu_Pays_v1.3-PS1.7.pdf)
[doc/Navod_k_pouziti_modulu_Pays_v1.4-PS8.pdf](doc/Navod_k_pouziti_modulu_Pays_v1.4-PS8.pdf)

Author: Pavel Strejček <aplikace@brainweb.cz>
Copyright: 2019-2021 Pavel Strejček
Copyright: 2019 - 2023 Pavel Strejček
License: Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0

Payment gateway operator and support: www.Pays.cz
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023/04/21 (version 1.0.8)
- General: changes for PS 8
- General: copy payment url function

2022/10/07 (version 1.0.7)
- General: Added setting for special order status RECEIVED
- General: Keep settings.php after module reinstallation.
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
Binary file removed doc/Navod_k_pouziti_modulu_Pays_v1.3-PS1.7.odt
Binary file not shown.
Binary file removed doc/Navod_k_pouziti_modulu_Pays_v1.3-PS1.7.pdf
Binary file not shown.
Binary file added doc/Navod_k_pouziti_modulu_Pays_v1.4-PS8.odt
Binary file not shown.
Binary file added doc/Navod_k_pouziti_modulu_Pays_v1.4-PS8.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion install/db_structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/OrderState.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion model/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
21 changes: 11 additions & 10 deletions pays_ps.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down Expand Up @@ -43,10 +43,10 @@ public function __construct()
{
$this->name = 'pays_ps';
$this->tab = 'payments_gateways';
$this->version = '1.0.7';
$this->version = '1.0.8';
$this->author = 'Pavel Strejček @ BrainWeb.cz';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => '1.7');
$this->ps_versions_compliancy = array('min' => '8.0', 'max' => '8.9');
$this->bootstrap = true;
$this->controllers = array('payment', 'validate', 'confirm');

Expand Down Expand Up @@ -97,8 +97,7 @@ public function __construct()
'cs' => 'CS-CZ',
'sk' => 'SK-SK',
'en' => 'EN-US',
'ru' => 'RU-RU',
'ja' => 'JA-JP'
'de' => 'DE-DE'
);
}

Expand Down Expand Up @@ -521,10 +520,10 @@ public function hookActionEmailAddAfterContent($params)
if ($orders instanceof PrestaShopCollection && $orders->count()) {
$order = $orders->getFirst();
if (!empty($params['template_html'])) {
$params['template_html'] = preg_replace('~\{payment\}~', '{payment} <br/>' . $this->l('If you have not already made a payment, you can pay:') . ' <a class="pays_ps-payment-link" href="' . htmlspecialchars($this->createPaymentUrl($order)) . '">' . $this->l('PAY NOW') . '</a>', $params['template_html']);
$params['template_html'] = preg_replace('~\{payment\}~', '{payment} <br/>' . $this->l('If you have not already made a payment, you can pay:') . ' <br/><a class="pays_ps-payment-link" href="' . htmlspecialchars($this->createPaymentUrl($order)) . '">' . $this->l('PAY NOW') . '</a>', $params['template_html']);
}
if (!empty($params['template_txt'])) {
$params['template_txt'] = preg_replace('~\{payment\}~', "{payment} \r\n" . $this->l('If you have not already made a payment, you can pay:') . ' [' . $this->createPaymentUrl($order) . ']', $params['template_txt']);
$params['template_txt'] = preg_replace('~\{payment\}~', "{payment} \r\n" . $this->l('If you have not already made a payment, you can pay:') . "\r\n[" . $this->createPaymentUrl($order) . ']', $params['template_txt']);
}
}
}
Expand Down Expand Up @@ -816,10 +815,12 @@ public function changeOrderStatus($order, $id_order_state)
}
$history->changeIdOrderState((int) $order_state->id, $order, $use_existings_payment);

$carrier = new Carrier($order->id_carrier, $order->id_lang);
$carrier = new Carrier($order->id_carrier, (int) $order->getAssociatedLanguage()->getId());
$templateVars = array();
if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) {
$templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url));
if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->getShippingNumber()) {
$templateVars = [
'{followup}' => str_replace('@', $order->getShippingNumber(), $carrier->url),
];
}

// Save all changes
Expand Down
1 change: 1 addition & 0 deletions translations/cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
$_MODULE['<{pays_ps}prestashop>pays_ps_7f1971cb6b14c0837f13a0ff198f28d0'] = 'Podporované měny:';
$_MODULE['<{pays_ps}prestashop>pays_ps_c9cc8cce247e49bae79f15173ce97354'] = 'Uložit';
$_MODULE['<{pays_ps}prestashop>pays_ps_630f6dc397fe74e52d5189e2c80f282b'] = 'Zpět na seznam';
$_MODULE['<{pays_ps}prestashop>pays_ps_edc8845564cc077e39a973a9d861527f'] = 'Pays: Nastavení PAY_PS_SPECIAL_ORDER_STATUS_PAYMENT_RECEIVED_ID není platné ID stavu objednávky. Použije se výchozí stav modulu.';
$_MODULE['<{pays_ps}prestashop>pays_ps_bd6647308faff81447cda7bc8d94f618'] = 'Pays: při potvrzení platby za službu nelze dokončit změnu stavu objednávky na položku \"Bezhotovostní platba PŘIJATA\".';
$_MODULE['<{pays_ps}prestashop>admin_order_d8cf9f84cd7d87118d5645328ed83ae2'] = 'Platební brána Pays';
$_MODULE['<{pays_ps}prestashop>admin_order_59113df7622c2b809c7b47e642a11d2f'] = 'Podepsané odpovědi z brány';
Expand Down
2 changes: 1 addition & 1 deletion translations/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion uninstall/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion uninstall/uninstall.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion upgrade/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion upgrade/sql/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion upgrade/upgrade-1.0.2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
14 changes: 14 additions & 0 deletions views/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@
.pays_ps-messsage-error{
color: red;
}
#pays_ps-paymentUrlCopy {
overflow: auto;
white-space: nowrap;
display: block;
background-color: #f7f7f7;
}

#pays_ps-paymentUrlCopyButton {
border: 1px solid #444444;
color: #444444;
background-color: #cbcbcb;
padding: 3px;
cursor: pointer;
}
2 changes: 1 addition & 1 deletion views/css/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion views/img/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
21 changes: 11 additions & 10 deletions views/js/admin-order-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
* Module development: www.BrainWeb.cz
*/

$(function () {
if ($('#formAddPaymentPanel').length) {
var $appendTo = $('#formAddPaymentPanel');
} else if ($('#view_order_payments_block').length) {
var $appendTo = $('#view_order_payments_block').find('.card-body');
}

if ($('#pays_ps-payment').length && $appendTo) {
$('#pays_ps-payment').detach().appendTo($appendTo);
}
var $appendTo = $('#view_order_payments_block').find('.card-body');
if ($('#pays_ps-payment').length && $appendTo) {
$('#pays_ps-payment').detach().appendTo($appendTo);
$('#pays_ps-paymentUrlCopyButton').click(function () {
var copyText = $('#pays_ps-paymentUrlCopy').text();
navigator.clipboard.writeText(copyText).then(() => {
alert("Copied to clipboard");
});
});
}
});

2 changes: 1 addition & 1 deletion views/js/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion views/js/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* to application@brainweb.cz so we can send you a copy..
*
* @author Pavel Strejček <aplikace@brainweb.cz>
* @copyright 2019 - 2021 Pavel Strejček
* @copyright 2019 - 2023 Pavel Strejček
* @license Licensed under the Open Software License version 3.0 https://opensource.org/licenses/OSL-3.0
*
* Payment gateway operator and support: www.Pays.cz
Expand Down
Loading

0 comments on commit e4f2588

Please sign in to comment.