Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.2.5 #238

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a1996d9
custom password input without escaping html
zuk3975 Nov 6, 2024
da24530
Merge pull request #221 from Invertus/release-v1.2.4
MarijusCoding Nov 7, 2024
afaf400
init
MarijusCoding Nov 15, 2024
9e7edb3
[SL-269] init
MarijusCoding Nov 19, 2024
4c01ab7
[SL-269] fix logic
MarijusCoding Nov 19, 2024
d1567ef
[SL-269] fix
MarijusCoding Nov 19, 2024
bc6dd43
[SL-270] initialize
MarijusCoding Nov 21, 2024
09fe150
[SL-271] fix
MarijusCoding Nov 22, 2024
a837691
[SL-271] bump version
MarijusCoding Nov 22, 2024
f887d77
[SL-271] added BLIK
MarijusCoding Nov 22, 2024
be2dc42
[SL-271] set BLIK redirect payment
MarijusCoding Nov 22, 2024
c6b1dab
[SL-271] removed dependency
MarijusCoding Nov 22, 2024
c5f7cd7
Merge pull request #228 from Invertus/SL-271/c2p-blik-integrate
MarijusCoding Nov 29, 2024
00dddbf
Merge pull request #226 from Invertus/SL-270/bo-performance
MarijusCoding Nov 29, 2024
6c10cae
Merge pull request #224 from Invertus/SL-269/javascript-update
MarijusCoding Nov 29, 2024
4e13f2f
init workflows
MarijusCoding Nov 29, 2024
20c4f29
Merge pull request #229 from Invertus/INTERNAL/update-workflow
MarijusCoding Nov 29, 2024
1f0c5cf
Revert "SL-271 New payment methods integration"
MarijusCoding Nov 29, 2024
bec1778
Merge pull request #231 from Invertus/revert-228-SL-271/c2p-blik-inte…
MarijusCoding Nov 29, 2024
74df985
SL-271] re-added
MarijusCoding Dec 12, 2024
efb7a6d
[SL-271] updated changelog
MarijusCoding Dec 12, 2024
a77ad83
changelog
MarijusCoding Dec 12, 2024
2b16baf
Merge pull request #232 from Invertus/SL-271/new-payments
MarijusCoding Dec 12, 2024
694d636
Merge branch 'release-v1.2.5' into password_input
MarijusCoding Dec 12, 2024
a14038a
Merge pull request #220 from Invertus/password_input
MarijusCoding Dec 12, 2024
c34b71d
init bugfix
MarijusCoding Dec 13, 2024
8c96455
fix
MarijusCoding Dec 13, 2024
b273cab
Merge pull request #234 from Invertus/SL-277/wallet-bugfix
MarijusCoding Dec 13, 2024
b51c289
[SL-270] fix
MarijusCoding Dec 13, 2024
327790d
Merge pull request #236 from Invertus/SL-277/wallet-bugfix
MarijusCoding Dec 13, 2024
1a1a83e
INTERNAL version bump
MarijusCoding Dec 13, 2024
d3169f0
Merge pull request #237 from Invertus/INTERNAL/version-bump
MarijusCoding Dec 13, 2024
49f8865
[INTERNAL] changelog
MarijusCoding Dec 13, 2024
c8503e6
Merge pull request #239 from Invertus/INTERNAL/version-bump
MarijusCoding Dec 13, 2024
e6f2be5
[INTERNAL] fix validator
MarijusCoding Dec 13, 2024
da9bac5
added infex files
MarijusCoding Dec 13, 2024
e583246
Merge pull request #240 from Invertus/INTERNAL/validator-fix
MarijusCoding Dec 13, 2024
0e5f1c8
[SL-278] init upgrade
MarijusCoding Dec 16, 2024
be27a34
Merge pull request #241 from Invertus/SL-278/maestro-error
MarijusCoding Dec 16, 2024
7d8040e
[BUGFIX] Fixed to execute right payment logic when not safer payment …
MarijusCoding Dec 18, 2024
fa5efbf
[BUGFIX] changelog.md
MarijusCoding Dec 18, 2024
6fb1501
Merge pull request #242 from Invertus/BUGFIX/bad-payment-executing
MarijusCoding Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Self-Checks
- [ ] I have performed a self-review of my code.
- [ ] I have updated/added necessary technical documentation in the [README](/README.md) file.

## Summary
<!-- Briefly explain the purpose of this PR in 1-2 sentences -->

## QA Checklist Labels
- [ ] Bug fix? <!-- Maps to "bug" label -->
- [ ] New feature? <!-- Maps to "feature" label -->
- [ ] Improvement? <!-- Maps to "improvement" label -->
- [ ] Technical debt? <!-- Maps to "debt" label -->
- [ ] Reusable? <!-- Maps to "reuse" label -->
- [ ] Covered by tests? <!-- Maps to "tested" label -->

## QA Checklist
<!-- Provide related ticket/PR's -->

## Additional Context
<!-- Provide a concise description of the changes made in this PR. -->

## Frontend Changes
<!-- If applicable, provide visual elements such as screenshots, GIFs, or videos to demonstrate frontend changes. -->
10 changes: 10 additions & 0 deletions .github/workflows/PULL_REQUEST_LABELS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Apply Labels Based on PR Template

on:
pull_request:
types: [opened, edited]

jobs:
label-management:
uses: Invertus/github-templates/.github/workflows/[email protected]
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/PULL_REQUEST_NAMING_RULES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Names rules

on: [pull_request, workflow_dispatch]

jobs:
branch-name-check:
uses: Invertus/github-templates/.github/workflows/[email protected]
secrets: inherit

pr-title-check:
uses: Invertus/github-templates/.github/workflows/[email protected]
secrets: inherit
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,10 @@
- Implemented code logging
- Requiring card holder name when entering card details
- Removed depreciated feature for custom CSS
- Compatibility with most popular OPC modules (The Checkout, Super Checkout, One Page Checkout PS)
- Compatibility with most popular OPC modules (The Checkout, Super Checkout, One Page Checkout PS)

## [1.2.5]
- Fixed issue with JSON API Password escaping HTML entities
- Added new payment methods: Blik, ClickToPay
- Fixed performance issues when loading "Payments" tab in Back office.
- Fixed issue when saferpay logic is executing on other payment methods which is not saferpay
21 changes: 15 additions & 6 deletions controllers/admin/AdminSaferPayOfficialPaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ protected function renderShoppingPointOptions()
$fieldsForm = [];
$fieldsForm[0]['form'] = $this->fields_form;

/** @var \Invertus\SaferPay\Service\SaferPayObtainPaymentMethods $saferPayObtainPaymentMethods */
$saferPayObtainPaymentMethods = $this->module->getService(SaferPayObtainPaymentMethods::class);

$paymentMethodsList = $saferPayObtainPaymentMethods->obtainPaymentMethods();

foreach ($paymentMethods as $paymentMethod) {
$isActive = $paymentRepository->isActiveByName($paymentMethod);
$isLogoActive = $logoRepository->isActiveByName($paymentMethod);
Expand All @@ -184,7 +189,7 @@ protected function renderShoppingPointOptions()
'paymentMethod' => $paymentMethod,
'countryOptions' => $this->getActiveCountriesList(),
'countrySelect' => $selectedCountries,
'currencyOptions' => $this->getActiveCurrenciesList($paymentMethod),
'currencyOptions' => $this->getActiveCurrenciesList($paymentMethod, $paymentMethodsList),
'currencySelect' => $selectedCurrencies,
'is_field_active' => $isFieldActive,
'supported_field_payments' => SaferPayConfig::FIELD_SUPPORTED_PAYMENT_METHODS,
Expand Down Expand Up @@ -219,14 +224,18 @@ public function getActiveCountriesList($onlyActive = true)
return $countriesWithNames;
}

public function getActiveCurrenciesList($paymentMethod)
public function getActiveCurrenciesList($paymentMethod, $paymentMethods)
{
/** @var \Invertus\SaferPay\Service\SaferPayObtainPaymentMethods $saferPayObtainPaymentMethods */
$saferPayObtainPaymentMethods = $this->module->getService(SaferPayObtainPaymentMethods::class);
$currencyOptions[0] = $this->l('All');

$paymentMethods = $saferPayObtainPaymentMethods->obtainPaymentMethods();
if (!isset($paymentMethods[$paymentMethod]['currencies']) && in_array($paymentMethod, SaferPayConfig::WALLET_PAYMENT_METHODS)) {
foreach (Currency::getCurrencies() as $currency) {
$currencyOptions[$currency['id_currency']] = $currency['iso_code'];
}

return $currencyOptions;
}

$currencyOptions[0] = $this->l('All');
foreach ($paymentMethods[$paymentMethod]['currencies'] as $currencyIso) {
if (Currency::getIdByIsoCode($currencyIso)) {
$currencyOptions[Currency::getIdByIsoCode($currencyIso)] = $currencyIso;
Expand Down
6 changes: 4 additions & 2 deletions controllers/admin/AdminSaferPayOfficialSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ public function initOptions()
],
SaferPayConfig::PASSWORD => [
'title' => $this->l('JSON API Password'),
'type' => 'text',
'type' => 'password_input',
'class' => 'fixed-width-xl',
'value' => Configuration::get(SaferPayConfig::PASSWORD),
],
SaferPayConfig::CUSTOMER_ID => [
'title' => $this->l('Customer ID'),
Expand Down Expand Up @@ -192,8 +193,9 @@ public function initOptions()
],
SaferPayConfig::PASSWORD . SaferPayConfig::TEST_SUFFIX => [
'title' => $this->l('JSON API Password'),
'type' => 'text',
'type' => 'password_input',
'class' => 'fixed-width-xl',
'value' => Configuration::get(SaferPayConfig::PASSWORD . SaferPayConfig::TEST_SUFFIX),
],
SaferPayConfig::CUSTOMER_ID . SaferPayConfig::TEST_SUFFIX => [
'title' => $this->l('Customer ID'),
Expand Down
15 changes: 11 additions & 4 deletions saferpayofficial.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*@license SIX Payment Services
*/

use Invertus\SaferPay\Config\SaferPayConfig;

if (!defined('_PS_VERSION_')) {
exit;
}
Expand All @@ -40,7 +42,7 @@ public function __construct($name = null)
{
$this->name = 'saferpayofficial';
$this->author = 'Invertus';
$this->version = '1.2.4';
$this->version = '1.2.5';
$this->module_key = '3d3506c3e184a1fe63b936b82bda1bdf';
$this->displayName = 'SaferpayOfficial';
$this->description = 'Saferpay Payment module';
Expand Down Expand Up @@ -216,11 +218,16 @@ public function hookPaymentOptions($params)
foreach ($paymentMethods as $paymentMethod) {
$paymentMethod['paymentMethod'] = str_replace(' ', '', $paymentMethod['paymentMethod']);

if (!in_array($paymentMethod['paymentMethod'], $activePaymentMethods)) {
continue;
if (in_array($paymentMethod['paymentMethod'], SaferPayConfig::WALLET_PAYMENT_METHODS)) {
foreach (Currency::getCurrencies() as $currency) {
$currencyOptions[$currency['id_currency']] = $currency['iso_code'];
}

$paymentMethod['currencies'] = $currencyOptions;
}

if (!in_array($this->context->currency->iso_code, $paymentMethods[$paymentMethod['paymentMethod']]['currencies'])) {
if (!in_array($this->context->currency->iso_code, $paymentMethod['currencies'])
&& !in_array($paymentMethod['paymentMethod'], SaferPayConfig::WALLET_PAYMENT_METHODS)) {
continue;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Adapter/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

namespace Invertus\SaferPay\Adapter;

if (!defined('_PS_VERSION_')) {
exit;
}

class Cart
{
/**
Expand Down
11 changes: 9 additions & 2 deletions src/Config/SaferPayConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SaferPayConfig
const RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT = 'SAFERPAY_RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT';
const CONFIGURATION_NAME = 'SAFERPAY_CONFIGURATION_NAME';
const TEST_SUFFIX = '_TEST';
const API_VERSION = '1.40';
const API_VERSION = '1.43';
const PAYMENT_METHODS = [
self::PAYMENT_ALIPAY,
self::PAYMENT_AMEX,
Expand Down Expand Up @@ -78,6 +78,7 @@ class SaferPayConfig
self::PAYMENT_WLCRYPTOPAYMENTS,
self::PAYMENT_WECHATPAY,
self::PAYMENT_ACCOUNTTOACCOUNT,
self::PAYMENT_CLICKTOPAY,
];

const PAYMENT_ALIPAY = 'ALIPAY';
Expand Down Expand Up @@ -113,10 +114,13 @@ class SaferPayConfig
const PAYMENT_CARD = 'CARD';
const PAYMENT_POSTFINANCE_PAY = 'POSTFINANCEPAY';
const PAYMENT_WECHATPAY = 'WECHATPAY';
const PAYMENT_CLICKTOPAY = 'CLICKTOPAY';
const PAYMENT_BLIK = 'BLIK';

const WALLET_PAYMENT_METHODS = [
self::PAYMENT_APPLEPAY,
self::PAYMENT_GOOGLEPAY,
self::PAYMENT_CLICKTOPAY,
];

const PAYMENT_METHODS_KEYS = [
Expand Down Expand Up @@ -144,6 +148,7 @@ class SaferPayConfig
'Card' => self::PAYMENT_CARD,
'PostFinancePay' => self::PAYMENT_POSTFINANCE_PAY,
'WeChatPay' => self::PAYMENT_WECHATPAY,
'Blik' => self::PAYMENT_BLIK,
];

const FIELD_SUPPORTED_PAYMENT_METHODS = [
Expand Down Expand Up @@ -315,7 +320,9 @@ public static function isRedirectPayment($paymentMethod)
self::PAYMENT_POSTFINANCE_PAY,
self::PAYMENT_DIRECTDEBIT,
self::PAYMENT_SOFORT,
self::PAYMENT_PAYPAL
self::PAYMENT_PAYPAL,
self::PAYMENT_CLICKTOPAY,
self::PAYMENT_BLIK,
];

return in_array($paymentMethod, $paymentsAlwaysRedirect);
Expand Down
31 changes: 31 additions & 0 deletions src/Context/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
*NOTICE OF LICENSE
*
*This source file is subject to the Open Software License (OSL 3.0)
*that is bundled with this package in the file LICENSE.txt.
*It is also available through the world-wide-web at this URL:
*http://opensource.org/licenses/osl-3.0.php
*If you did not receive a copy of the license and are unable to
*obtain it through the world-wide-web, please send an email
*to [email protected] so we can send you a copy immediately.
*
*DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
*versions in the future. If you wish to customize PrestaShop for your
*needs please refer to http://www.prestashop.com for more information.
*
*@author INVERTUS UAB www.invertus.eu <[email protected]>
*@copyright SIX Payment Services
*@license SIX Payment Services
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
4 changes: 4 additions & 0 deletions src/Controller/AbstractAdminSaferPayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
use Invertus\SaferPay\Response\JsonResponse;
use Invertus\SaferPay\Utility\ExceptionUtility;

if (!defined('_PS_VERSION_')) {
exit;
}

class AbstractAdminSaferPayController extends \ModuleAdminController
{
const FILE_NAME = 'AbstractAdminSaferPayController';
Expand Down
31 changes: 31 additions & 0 deletions src/EntityManager/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
*NOTICE OF LICENSE
*
*This source file is subject to the Open Software License (OSL 3.0)
*that is bundled with this package in the file LICENSE.txt.
*It is also available through the world-wide-web at this URL:
*http://opensource.org/licenses/osl-3.0.php
*If you did not receive a copy of the license and are unable to
*obtain it through the world-wide-web, please send an email
*to [email protected] so we can send you a copy immediately.
*
*DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
*versions in the future. If you wish to customize PrestaShop for your
*needs please refer to http://www.prestashop.com for more information.
*
*@author INVERTUS UAB www.invertus.eu <[email protected]>
*@copyright SIX Payment Services
*@license SIX Payment Services
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
31 changes: 31 additions & 0 deletions src/Logger/Formatter/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
*NOTICE OF LICENSE
*
*This source file is subject to the Open Software License (OSL 3.0)
*that is bundled with this package in the file LICENSE.txt.
*It is also available through the world-wide-web at this URL:
*http://opensource.org/licenses/osl-3.0.php
*If you did not receive a copy of the license and are unable to
*obtain it through the world-wide-web, please send an email
*to [email protected] so we can send you a copy immediately.
*
*DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
*versions in the future. If you wish to customize PrestaShop for your
*needs please refer to http://www.prestashop.com for more information.
*
*@author INVERTUS UAB www.invertus.eu <[email protected]>
*@copyright SIX Payment Services
*@license SIX Payment Services
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
4 changes: 4 additions & 0 deletions src/Logger/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
use Invertus\SaferPay\Provider\BasicIdempotencyProvider;
use Invertus\SaferPay\Repository\PrestashopLoggerRepositoryInterface;

if (!defined('_PS_VERSION_')) {
exit;
}

class Logger implements LoggerInterface
{
const FILE_NAME = 'Logger';
Expand Down
31 changes: 31 additions & 0 deletions src/Logger/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
*NOTICE OF LICENSE
*
*This source file is subject to the Open Software License (OSL 3.0)
*that is bundled with this package in the file LICENSE.txt.
*It is also available through the world-wide-web at this URL:
*http://opensource.org/licenses/osl-3.0.php
*If you did not receive a copy of the license and are unable to
*obtain it through the world-wide-web, please send an email
*to [email protected] so we can send you a copy immediately.
*
*DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
*versions in the future. If you wish to customize PrestaShop for your
*needs please refer to http://www.prestashop.com for more information.
*
*@author INVERTUS UAB www.invertus.eu <[email protected]>
*@copyright SIX Payment Services
*@license SIX Payment Services
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
3 changes: 3 additions & 0 deletions src/Service/LegacyTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ private function getTranslations()
SaferPayConfig::PAYMENT_CARD => $this->module->l('Card', self::FILE_NAME),
SaferPayConfig::PAYMENT_POSTFINANCE_PAY => $this->module->l('PostFinancePay', self::FILE_NAME),
SaferPayConfig::PAYMENT_WECHATPAY => $this->module->l('WeChatPay', self::FILE_NAME),
SaferPayConfig::PAYMENT_BLIK => $this->module->l('Blik', self::FILE_NAME),
SaferPayConfig::PAYMENT_GOOGLEPAY => $this->module->l('Googlepay'),
SaferPayConfig::PAYMENT_CLICKTOPAY => $this->module->l('Clicktopay', self::FILE_NAME),
];
}
}
1 change: 0 additions & 1 deletion src/Service/SaferPayObtainPaymentMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public function obtainPaymentMethods()
$paymentMethods[$wallet->WalletName] = [
'paymentMethod' => $wallet->WalletName,
'logoUrl' => $wallet->LogoUrl,
'currencies' => $paymentMethodObject->Currencies,
];
}
}
Expand Down
Loading
Loading