Skip to content

Commit

Permalink
Merge pull request #900 from mollie/develop
Browse files Browse the repository at this point in the history
Develop-6.1.1
  • Loading branch information
JevgenijVisockij committed Apr 17, 2024
2 parents 1d60186 + 243afb2 commit 668c8c1
Show file tree
Hide file tree
Showing 35 changed files with 6,411 additions and 937 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM prestashop/prestashop:8.1.3-apache
FROM prestashop/prestashop:8.1.5-apache

RUN cd /usr/local/etc/php/conf.d/ && \
echo 'memory_limit = 4096M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/E2E_On_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ jobs:
fail-fast: false
matrix:
include:
- prestashop: 'PS1785'
make: 'make VERSION=1785 e2eh1785'
subdomain: 'demoshop1785'
port: '8002'
yml: 'docker-compose.1785.yml'
url: 'https://demoshop1785.ngrok.io'
test_spec: '**/cypress/e2e/ps1785/**'
TestRailID: R4954
# temporary WIP for this PS version, possible bug blocker
# - prestashop: 'PS1785'
# make: 'make VERSION=1785 e2eh1785'
# subdomain: 'demoshop1785'
# port: '8002'
# yml: 'docker-compose.1785.yml'
# url: 'https://demoshop1785debug.ngrok.io'
# test_spec: '**/cypress/e2e/ps1785/**'
# TestRailID: R4954
- prestashop: 'PS8'
make: 'make VERSION=8 e2eh8'
subdomain: 'demoshop8'
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# Changelog #

## Changes in release 6.1.1 ##
+ Updated translations for Dutch, German, English and French languages
+ Added credit card translations for Italian and Spanish languages
+ Fixed issue where fatal exception was thrown in case of ps accounts version being too low
+ Fixed issue where in case of familyName error from mollie 502 was returned instead of 400
+ Fixed issue with credit card iframe not translating errors


## Changes in release 6.1.0 ##
+ New payment methods: Twint, Blik and Klarna
+ Added PrestaShop CloudSync support
Expand Down
28 changes: 16 additions & 12 deletions controllers/admin/AdminMollieSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct()
$this->bootstrap = true;
}

private function initCloudSyncAndPsAccounts(): bool
private function initCloudSyncAndPsAccounts(): void
{
$mboInstaller = new Prestashop\ModuleLibMboInstaller\DependencyBuilder($this->module);

Expand All @@ -37,7 +37,7 @@ private function initCloudSyncAndPsAccounts(): bool

$this->content .= $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/dependency_builder.tpl');

return false;
return;
}

$this->context->smarty->assign('module_dir', $this->module->getPathUri());
Expand All @@ -47,12 +47,17 @@ private function initCloudSyncAndPsAccounts(): bool
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
} catch (PrestaShop\PsAccountsInstaller\Installer\Exception\InstallerException $e) {
$accountsInstaller = $this->module->getService('Mollie.PsAccountsInstaller');
$accountsInstaller->install();
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
try {
$accountsInstaller = $this->module->getService('Mollie.PsAccountsInstaller');
$accountsInstaller->install();
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
} catch (Exception $e) {
$this->context->controller->errors[] = $e->getMessage();

return;
}
}

try {
Media::addJsDef([
'contextPsAccounts' => $accountsFacade->getPsAccountsPresenter()
Expand Down Expand Up @@ -81,7 +86,7 @@ private function initCloudSyncAndPsAccounts(): bool

$this->content .= $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/cloudsync.tpl');

return true;
return;
}

public function postProcess()
Expand All @@ -94,10 +99,9 @@ public function postProcess()
$this->module->getService(\Mollie\Builder\Content\LogoInfoBlock::class),
$this->module->getLocalPath() . 'views/templates/admin/logo.tpl'
);
$cloudSyncComplete = $this->initCloudSyncAndPsAccounts();
if (!$cloudSyncComplete) {
return;
}

$this->initCloudSyncAndPsAccounts();

/** @var \Mollie\Repository\ModuleRepository $moduleRepository */
$moduleRepository = $this->module->getService(\Mollie\Repository\ModuleRepository::class);
$moduleDatabaseVersion = $moduleRepository->getModuleDatabaseVersion($this->module->name);
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = defineConfig({
// return config;
// },
experimentalMemoryManagement: true,
excludeSpecPattern: ['index.php'],
excludeSpecPattern: ['index.php', 'cypress/e2e/ps1785'],
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ describe('PS1785 Module initial configuration setup', () => {
it('C339305: 01 Connecting test API successsfully', () => {
cy.visit('/admin1/')
cy.OpeningModuleDashboardURL()
cy.get('body')
.invoke('text').should('contain','Mollie')
.then((text) => {
cy.log(text) // Showing and asserting the text that loaded, to ensure the BO is loaded, not crashed with PHP fatals etc.
})
cy.iframe('[id^="uid_"]').find('button').click() // Cloudsync validation
cy.get('#MOLLIE_ACCOUNT_SWITCH_on').click({force:true})
cy.get('#MOLLIE_API_KEY_TEST').type((Cypress.env('MOLLIE_TEST_API_KEY')),{delay: 0, log: false})
cy.get('#module_form_submit_btn').click()
Expand Down
43 changes: 42 additions & 1 deletion cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,48 @@ it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => { // currently not supported for PS, skipping temporary
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
// TODO - some reported possible bugs in the workflow, but still continuing on completing the tests...
it.only('Blik Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Blik').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.only('Blik Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
it('TWINT Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('TWINT').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('TWINT Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
})
30 changes: 26 additions & 4 deletions cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,44 @@ it('C339401: 66 Bank Transfer Checkouting [Payments API]', () => {
it('C339402: 67 Bank Transfer BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it.skip('C1860462: Pay with Klarna UK Checkouting [Payments API]', () => { // TODO - temporary skip, issue, Orders API is available to Order
// TODO - some reported possible bugs in the workflow, but still continuing on completing the tests...
it.only('Blik Checkouting [Payments API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Blik').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.only('Blik Order Shipping, Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
it('TWINT Checkouting [Payments API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Pay with Klarna').click({force:true})
cy.contains('TWINT').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.get('.ps-shown-by-js > .btn').click()
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C1860463: Pay with Klarna UK Order BO Refunding, Partial Refunding [Payments API]', () => { // TODO - temporary skip, issue, Orders API is available to Order
it('TWINT Order Shipping, Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
})
5 changes: 4 additions & 1 deletion cypress/e2e/ps1785/07_mollie.ps1785.Cloudsync.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ describe('PS8 Cloudsync tests', () => {
cy.viewport(1920,1080)
cy.CachingBOFOPS1785()
})
it('Checking if Cloudsync UI is appearing in the module', () => {
it('Checking if CloudSync UI is appearing in the module', () => {
cy.OpeningModuleDashboardURL()
cy.CloudSyncUI()
})
it('Linking the Shop to the PS CloudSync', () => {
cy.CloudSyncLink()
});
})
7 changes: 6 additions & 1 deletion cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ it('C339305: Connecting test API successsfully', () => {
cy.visit('/admin1/')
cy.get('.mi-mollie').click({fore:true})
cy.get('#subtab-AdminMollieModule').click()
cy.get('body')
.invoke('text').should('contain','Mollie')
.then((text) => {
cy.log(text) // Showing and asserting the text that loaded, to ensure the BO is loaded, not crashed with PHP fatals etc.
})
cy.iframe('[id^="uid_"]').find('button').click() // Cloudsync validation
cy.get('#MOLLIE_ACCOUNT_SWITCH_on').click({force:true})
cy.get('#MOLLIE_API_KEY_TEST').type((Cypress.env('MOLLIE_TEST_API_KEY')),{delay: 0, log: false})
cy.get('#module_form_submit_btn').click()
Expand Down Expand Up @@ -89,6 +95,5 @@ it('C688473: Checking the Subscriptions FAQ, and console errors', () => {
cy.get(':nth-child(5) > .col-lg-12 > .card').should('be.visible')
cy.get(':nth-child(6) > .col-lg-12 > .card').should('be.visible')
cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches

});
})
11 changes: 5 additions & 6 deletions cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ it('C339357: 20 IN3 Checkouting [Orders API]', () => { // wip
cy.navigatingToThePaymentPS8()
//Payment method choosing
// waiting for enabling IN3 payment
cy.contains('in3').click({force:true})
cy.contains('in 3').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
})
it('C339358: 21 IN3 Order BO Shipping, Refunding [Orders API]', () => { // checking why payment div is not loaded in the Orders for some reason
it('C339358: 21 IN3 Order BO Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339359: 22 IN3 should not be shown under 5000 EUR [Orders API]', () => {
Expand All @@ -153,7 +153,7 @@ it('C339359: 22 IN3 should not be shown under 5000 EUR [Orders API]', () => {
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('in3').should('not.exist')
cy.contains('in 3').should('not.exist')
})
it('C339360: 23 IN3 Checking that IN3 logo exists OK [Orders API]', () => {
cy.visit('/admin1/')
Expand Down Expand Up @@ -307,7 +307,7 @@ it('C1765085: Billie Checkouting [Orders API]', () => {
it('C1765086: Billie Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => { // currently not supported for PS, skipping temporary
it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
Expand All @@ -322,7 +322,6 @@ it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => { // currently
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => { // currently not supported for PS, skipping temporary
cy.OrderShippingRefundingOrdersAPI()
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => {
})
})
Loading

0 comments on commit 668c8c1

Please sign in to comment.