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

PIPRES-489 PrestaShop 9 compatibility #1014

Merged
merged 69 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
401a2f3
init
MarijusCoding Dec 3, 2024
74b340f
updated composer.json
MarijusCoding Dec 3, 2024
7f7bed7
Added namespaces into right places
MarijusCoding Dec 3, 2024
26e21c3
[PIPRES-489] namespace rename
MarijusCoding Dec 3, 2024
43c48ca
[PIPRES-489] cslint fix
MarijusCoding Dec 3, 2024
662dc4c
[PIPRES-489] edit workflows to work with php-scoper
MarijusCoding Dec 3, 2024
b569879
Merge pull request #1002 from MarijusCoding/PIPRES-489/phpscoper-impl…
GytisZum Dec 16, 2024
f94d18c
ps 9 compatibility improvements
GytisZum Dec 16, 2024
e6f02ee
Merge branch 'PIPRES-489/ps9-compatibility' of github.com:mollie/Pres…
GytisZum Dec 16, 2024
9dc0c4a
removed scoper dependency
GytisZum Dec 16, 2024
10b7229
back office compatibility with prestashop 9
GytisZum Dec 17, 2024
f756360
subsciption symfony controller fixed
GytisZum Dec 17, 2024
8d5055d
compatibility with 176 added
GytisZum Dec 17, 2024
61734ed
[PIPRES-489] improved translator changed class with factory
MarijusCoding Jan 6, 2025
22fe56a
Merge branch 'master' of github.com:mollie/PrestaShop into PIPRES-489…
MarijusCoding Jan 29, 2025
cb23ef4
[PIPRES-489] rollback
MarijusCoding Jan 29, 2025
955805c
[PIPRES-489] fix tab icon
MarijusCoding Jan 29, 2025
f08a119
[PIPRES-489] removing controller services, because it is gettins erro…
MarijusCoding Jan 30, 2025
9796ae2
[PIPRES-489] alignment
MarijusCoding Feb 4, 2025
5ad6f71
[PIPRES-489] logger
MarijusCoding Feb 4, 2025
0d5e59f
[PIPRES-489] fix
MarijusCoding Feb 4, 2025
0a19c15
[PIRES-489] fix cslinter
MarijusCoding Feb 5, 2025
dff6e3e
[PIPRES-489] fix
MarijusCoding Feb 5, 2025
800f35f
Merge branch 'develop' of github.com:mollie/PrestaShop into PIPRES-48…
MarijusCoding Feb 5, 2025
e9e9f97
Merge branch 'develop' of github.com:mollie/PrestaShop into PIPRES-48…
MarijusCoding Feb 11, 2025
b440e5f
Merge branch 'develop' of github.com:mollie/PrestaShop into PIPRES-48…
MarijusCoding Feb 11, 2025
954c626
[PIPRES-489] Fix logger issues
MarijusCoding Feb 11, 2025
64f3019
[PIPRES-489] fixed no container set error
MarijusCoding Feb 13, 2025
374dd9a
[PIPRES-489] phpstan
MarijusCoding Feb 13, 2025
adf6501
[PIPRES-489] fix
MarijusCoding Feb 13, 2025
6f35a61
[PIPRES-489] fix stan
MarijusCoding Feb 17, 2025
698d4fc
[PIPRES-489] fix cslint
MarijusCoding Feb 17, 2025
80c2e2a
[PIPRES-489] fix cslint
MarijusCoding Feb 17, 2025
11850ec
[PIPRES-489] license
MarijusCoding Feb 17, 2025
e60be32
[PIPRES-489] testing compatibility
MarijusCoding Feb 17, 2025
b5a82f2
[PIPRES-489] fix
MarijusCoding Feb 17, 2025
38580f4
[PIPRES-489] fix ps compatibiltiy
MarijusCoding Feb 17, 2025
e573ab8
[PIPRES-489] fix ps9 com
MarijusCoding Feb 17, 2025
70f8657
[PIPRES-489] remove ps 9 load yml
MarijusCoding Feb 17, 2025
a47a305
[PIPRES-489] remove validation
MarijusCoding Feb 17, 2025
dfb3cec
[PIPRES-489] fix
MarijusCoding Feb 17, 2025
e65001b
[PIPRES-489] phpdocs
MarijusCoding Feb 17, 2025
86fab30
[PIPRES-489] fix
MarijusCoding Feb 17, 2025
4e78bfb
[PIPRES-489] uncomment
MarijusCoding Feb 17, 2025
3eb3c3f
[PIPRES-489] delete useless doc
MarijusCoding Feb 17, 2025
ce33177
[PIPRES-489] fix
MarijusCoding Feb 17, 2025
5fd29bc
[PIPRES-489] rollback
MarijusCoding Feb 17, 2025
3222f9c
[PIPRES-489] PrestaLogger deprecated
MarijusCoding Feb 17, 2025
2ad8dd7
[PIPRES-489] fix
MarijusCoding Feb 17, 2025
725998a
[PIPRES-489] minor fix
MarijusCoding Feb 18, 2025
0919c4d
[PIPRES-489] bump version
MarijusCoding Feb 18, 2025
89516fa
Merge branch 'develop' into PIPRES-489/ps9-compatibility
MarijusCoding Feb 18, 2025
1b68319
[PIPRES-489] fix
MarijusCoding Feb 18, 2025
c5bad97
Merge branch 'PIPRES-489/ps9-compatibility' of github.com:mollie/Pres…
MarijusCoding Feb 18, 2025
ae26e16
[PIPRES-489] fix
MarijusCoding Feb 18, 2025
f402e61
[PIPRES-489] fix
MarijusCoding Feb 18, 2025
e403811
[PIPRES-489] fix
MarijusCoding Feb 18, 2025
5770a94
[PIPRES-489] fix
MarijusCoding Feb 19, 2025
c11da0e
[PIPRES-489] fix
MarijusCoding Feb 19, 2025
82c76b7
fix
MarijusCoding Feb 19, 2025
99fc818
FIX
MarijusCoding Feb 19, 2025
5c6faf4
[PIPRES489] fx
MarijusCoding Feb 19, 2025
4161e64
[PIPES-489] fix
MarijusCoding Feb 20, 2025
03f2e33
[PIPRES-489] fix
MarijusCoding Feb 20, 2025
4ab6bdb
Merge branch 'develop' of github.com:mollie/PrestaShop into PIPRES-48…
MarijusCoding Feb 20, 2025
5ab6730
fix
MarijusCoding Feb 20, 2025
f9d8a36
fix
MarijusCoding Feb 20, 2025
d4d8857
fix
MarijusCoding Feb 20, 2025
65cec30
fix
MarijusCoding Feb 20, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/E2E_On_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
DB_PASSWD: ${{ secrets.DB_PASSWD }}
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v4
- run: wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
shell: bash
- run: unzip -qq -o ngrok-stable-linux-amd64.zip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: build
# IF YOU EDIT THIS, DON'T FORGET TO EDIT release.yml
run: |
Expand All @@ -32,7 +32,7 @@ jobs:
find . -maxdepth 1 -type f -exec rm "{}" \;
cd mollie && rm -rf mollie
- name: Archive production artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: mollie
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/midnight_status_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v4

- name: NPM install
run: npm ci

- name: Run Cypress on PS16, PS17, PS177
run: npx cypress run --env demousername=${{ secrets.DEMO_USER }},demopassword=${{ secrets.DEMO_PASS }},FO_username=${{ secrets.MOLLIE_FO_USR }},FO_password=${{ secrets.MOLLIE_FO_PSW }},mollie_test_api_key=${{ secrets.MOLLIE_TEST_API_KEY }},mollie_test_profile_id=${{ secrets.MOLLIE_TEST_PROFILE_ID }}
#--parallel --record --key fe20a60a-0ac6-4956-a6e8-911aad86cb03

- name: Archive videos and screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: videos_screenshots
retention-days: 1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v4

- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
Expand All @@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.0.0
uses: actions/checkout@v4

- name: Install composer
run: composer i

- name: Cache composer folder
uses: actions/cache@v4.0.0
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-cache
Expand All @@ -46,16 +46,16 @@ jobs:
presta-versions: [ '1.7.6.8', '1.7.7.0', 'nightly-apache' ]
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v4

- name: Cache vendor folder
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: Cache composer folder
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrading_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
ModuleUpgradeTest: 'make VERSION=1785 upgrading-module-test-1785'
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4

- name: Install composer
run: composer update
Expand Down
16 changes: 16 additions & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ services:
- '@subscription_options_data_provider'
- 'subscription_options': 'Mollie\Subscription\Form\Options\SubscriptionOptionsType'
- 'SubscriptionOptions'

Mollie\Subscription\Controller\Symfony\SubscriptionFAQController:
class: Mollie\Subscription\Controller\Symfony\SubscriptionFAQController
arguments:
- '@service_container' # Inject the service container for PS 9.0
- '@twig'
tags:
- { name: 'controller.service_arguments' }

Mollie\Subscription\Controller\Symfony\SubscriptionController:
class: Mollie\Subscription\Controller\Symfony\SubscriptionController
arguments:
- '@service_container' # Inject the service container for PS 9.0
- '@twig'
tags:
- { name: 'controller.service_arguments' }
13 changes: 8 additions & 5 deletions controllers/admin/AdminMollieAjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class AdminMollieAjaxController extends ModuleAdminController
public function postProcess()
{
$action = Tools::getValue('action');

$this->context->smarty->assign('bootstrap', true);

switch ($action) {
case 'togglePaymentMethod':
$this->togglePaymentMethod();
Expand Down Expand Up @@ -80,7 +83,7 @@ private function togglePaymentMethod()
}
$method->update();

$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'success' => true,
'paymentStatus' => (int) $method->enabled,
Expand All @@ -100,7 +103,7 @@ private function resendPaymentMail()

$response = $molliePaymentMailService->sendSecondChanceMail($orderId);

$this->ajaxDie(json_encode($response));
$this->ajaxRender(json_encode($response));
}

/**
Expand All @@ -119,7 +122,7 @@ private function testApiKeys()
$apiKeysTestInfo = $apiTestFeedbackBuilder->buildParams();

$this->context->smarty->assign($apiKeysTestInfo);
$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'template' => $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/api_test_results.tpl'),
]
Expand All @@ -141,7 +144,7 @@ private function validateLogo()
$returnText = '';
// Check image format
if ('jpg' !== $imageFileType && 'png' !== $imageFileType) {
$returnText = $this->l('Upload a .jpg or .png file.');
$returnText = $this->module->l('Upload a .jpg or .png file.');
$isUploaded = 0;
}

Expand All @@ -151,7 +154,7 @@ private function validateLogo()
$returnText = basename($_FILES['fileToUpload']['name']);
} else {
$isUploaded = 0;
$returnText = $this->l('Something went wrong when uploading your logo.');
$returnText = $this->module->l('Something went wrong when uploading your logo.');
}
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminMollieLogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ protected function ajaxResponse($value = null, $controller = null, $method = nul
$logger = $this->module->getService(LoggerInterface::class);

try {
$this->ajaxDie($value, $controller, $method);
$this->ajaxRender($value, $controller, $method);
} catch (\Exception $exception) {
$logger->error(sprintf('%s - Could not return ajax response', self::FILE_NAME), [
'context' => [
Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminMollieSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public function postProcess()

Media::addJsDef([
'description_message' => addslashes($this->module->l('Enter a description')),
'min_amount_message' => addslashes($this->l('You have entered incorrect min amount')),
'max_amount_message' => addslashes($this->l('You have entered incorrect max amount')),
'min_amount_message' => addslashes($this->module->l('You have entered incorrect min amount')),
'max_amount_message' => addslashes($this->module->l('You have entered incorrect max amount')),

'payment_api' => addslashes(Mollie\Config\Config::MOLLIE_PAYMENTS_API),
'ajaxUrl' => addslashes($this->context->link->getAdminLink('AdminMollieAjax')),
Expand Down
12 changes: 6 additions & 6 deletions controllers/front/applePayDirectAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getApplePaySession()
);
$response = $handler->handle($command);

$this->ajaxDie(json_encode($response));
$this->ajaxRender(json_encode($response));
}

private function updateShippingMethod()
Expand All @@ -94,7 +94,7 @@ private function updateShippingMethod()
);
$response = $handler->handle($command);

$this->ajaxDie(json_encode($response));
$this->ajaxRender(json_encode($response));
}

private function updateAppleShippingContact()
Expand Down Expand Up @@ -142,7 +142,7 @@ private function updateAppleShippingContact()
];
}

$this->ajaxDie(json_encode($result));
$this->ajaxRender(json_encode($result));
}

private function createApplePayOrder()
Expand All @@ -167,21 +167,21 @@ private function createApplePayOrder()
);
$response = $handler->handle($command);
if (!$response['success']) {
$this->ajaxDie(json_encode($response));
$this->ajaxRender(json_encode($response));
}

//we need to recover created order with customer settings so that we can show order confirmation page
OrderRecoverUtility::recoverCreatedOrder($this->context, $cart->id_customer);

$this->ajaxDie(json_encode($response));
$this->ajaxRender(json_encode($response));
}

private function getTotalApplePayCartPrice()
{
$cartId = Tools::getValue('cartId');
$cart = new Cart($cartId);

$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'total' => $cart->getOrderTotal(),
]
Expand Down
10 changes: 5 additions & 5 deletions controllers/front/bancontactAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function createTransaction()
);
$newPayment = $this->module->getApiClient()->payments->create($paymentData->jsonSerialize(), ['include' => 'details.qrCode']);

$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'qr_code' => $newPayment->details->qrCode->src,
]
Expand All @@ -96,7 +96,7 @@ private function checkForPaidTransaction()
$cart = Context::getContext()->cart;

$proc = function () use ($cart) {
$orderId = Order::getOrderByCartId($cart->id);
$orderId = Order::getIdByCartId($cart->id);
/* @phpstan-ignore-next-line */
if (!$orderId) {
throw new OrderCreationException('Order was not created in webhook', OrderCreationException::ORDER_IS_NOT_CREATED);
Expand All @@ -115,15 +115,15 @@ private function checkForPaidTransaction()
]
);
} catch (RetryOverException $e) {
$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'success' => false,
]
));
}

if (!$orderId) {
$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'success' => false,
]
Expand All @@ -143,7 +143,7 @@ private function checkForPaidTransaction()
);
OrderRecoverUtility::recoverCreatedOrder($this->context, $cart->id_customer);

$this->ajaxDie(json_encode(
$this->ajaxRender(json_encode(
[
'success' => true,
'redirectUrl' => $successUrl,
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/fail.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function init()

$redirectLink = 'index.php?controller=history';

$orderId = (int) Order::getOrderByCartId((int) $this->id_cart); /* @phpstan-ignore-line */
$orderId = (int) Order::getIdByCartId((int) $this->id_cart); /* @phpstan-ignore-line */

$this->id_order = $orderId;
$this->secure_key = Tools::getValue('secureKey');
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function initContent()

try {
if ($method === PaymentMethod::BANKTRANSFER) {
$orderId = Order::getOrderByCartId($cart->id);
$orderId = Order::getIdByCartId($cart->id);
$order = new Order($orderId);
$paymentMethodRepository->addOpenStatusPayment(
$cart->id,
Expand Down
Loading