Skip to content

Commit eaf1d2d

Browse files
Merge pull request #871 from mollie/release/2.44.0
Release/2.44.0
2 parents 4aad9bf + c610060 commit eaf1d2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+470
-117
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL

.github/workflows/codesniffer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
build:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v4
99

1010
- name: Run codesniffer
1111
run:

.github/workflows/end-2-end-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Remove run E2E tests label
33-
uses: actions/github-script@v5
33+
uses: actions/github-script@v7
3434
with:
3535
script: |
3636
github.rest.issues.removeLabel({
@@ -74,7 +74,7 @@ jobs:
7474
CYPRESS_TESTRAIL_RUN_NAME: "Github Workflow, ${{ github.head_ref || github.ref_name }}, PHP version: ${{ matrix.PHP_VERSION }}, Magento version: ${{ matrix.MAGENTO_VERSION }}"
7575
CYPRESS_TESTRAIL_RUN_CLOSE: true
7676
steps:
77-
- uses: actions/checkout@v2
77+
- uses: actions/checkout@v4
7878

7979
- name: Start the Magento container
8080
run: |
@@ -135,10 +135,10 @@ jobs:
135135
docker compose -f .github/workflows/templates/docker-compose.yml logs e2e > e2e.log
136136
137137
- name: Upload artifacts
138-
uses: actions/upload-artifact@v3
138+
uses: actions/upload-artifact@v4
139139
if: always()
140140
with:
141-
name: E2E logs - ${{ matrix.PHP_VERSION }} - ${{ matrix.MAGENTO_VERSION }}
141+
name: E2E logs - ${{ matrix.PHP_VERSION }} - ${{ matrix.MAGENTO_VERSION }} - API ${{ matrix.NO_API_KEY_TEST }}
142142
path: |
143143
Test/End-2-end/cypress/videos
144144
Test/End-2-end/cypress/screenshots

.github/workflows/integration-test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [push, pull_request]
44
jobs:
55
build:
66
strategy:
7+
fail-fast: false
78
matrix:
89
include:
910
- PHP_VERSION: php73-fpm
@@ -18,7 +19,7 @@ jobs:
1819
MAGENTO_VERSION: 2.4.7
1920
runs-on: ubuntu-latest
2021
steps:
21-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2223

2324
- name: Start Docker
2425
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}
@@ -30,7 +31,11 @@ jobs:
3031
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev
3132

3233
- name: Activate the extension
33-
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated"
34+
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade"
35+
36+
- name: Set developer mode for 2.3.7 and 2.4.0
37+
if: ${{ matrix.MAGENTO_VERSION == '2.3.7-p4' || matrix.MAGENTO_VERSION == '2.4.0' }}
38+
run: docker exec magento-project-community-edition ./retry "php bin/magento deploy:mode:set developer"
3439

3540
- name: Run tests
3641
run: docker exec magento-project-community-edition bash -c "cd /data/dev/tests/integration/ && /data/vendor/bin/phpunit -c /data/dev/tests/integration/phpunit.xml"

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v4
2626

2727
- name: Start Docker
2828
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}
@@ -37,7 +37,7 @@ jobs:
3737
run: docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev
3838

3939
- name: Activate the extension
40-
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated && php bin/magento setup:di:compile"
40+
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:di:compile && php bin/magento setup:upgrade --keep-generated"
4141

4242
- name: Run PHPStan
4343
continue-on-error: ${{ matrix.PHPSTAN_LEVEL == 2 }}

.github/workflows/setup-di-compile.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/templates/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ services:
3535
- "nginx-proxy:magento.test"
3636
environment:
3737
- NO_API_KEY_TEST
38+
- MAGENTO_VERSION
3839
- CYPRESS_TESTRAIL_DOMAIN
3940
- CYPRESS_TESTRAIL_USERNAME
4041
- CYPRESS_TESTRAIL_PASSWORD

.github/workflows/templates/magento/configure-mollie.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ bin/magento config:set payment/mollie_methods_pointofsale/active 1
3939
bin/magento config:set payment/mollie_methods_riverty/active 1
4040
bin/magento config:set payment/mollie_methods_satispay/active 1
4141
bin/magento config:set payment/mollie_methods_sofort/active 1
42+
bin/magento config:set payment/mollie_methods_swish/active 1
4243
bin/magento config:set payment/mollie_methods_trustly/active 1
4344
bin/magento config:set payment/mollie_methods_twint/active 1
4445

4546
# Enable Components
4647
bin/magento config:set payment/mollie_methods_creditcard/use_components 1
4748

4849
# Configure currency for the swiss store view
49-
bin/magento config:set currency/options/allow EUR,CHF,PLN
50+
bin/magento config:set currency/options/allow EUR,CHF,PLN,SEK
5051

5152
# Swiss scope
5253
bin/magento config:set currency/options/default CHF --scope=ch --scope-code=ch
@@ -56,12 +57,17 @@ bin/magento config:set payment/mollie_general/currency 0 --scope=ch --scope-code
5657
bin/magento config:set currency/options/default PLN --scope=pl --scope-code=pl
5758
bin/magento config:set payment/mollie_general/currency 0 --scope=pl --scope-code=pl
5859

60+
# Swedish scope
61+
bin/magento config:set currency/options/default SEK --scope=store --scope-code=se
62+
bin/magento config:set payment/mollie_general/currency 0 --scope=store --scope-code=se
63+
5964
# Disable the use of the base currency
6065
bin/magento config:set payment/mollie_general/currency 0
6166

6267
# Insert rates, otherwise the currency switcher won't show
6368
magerun2 db:query 'INSERT INTO `directory_currency_rate` (`currency_from`, `currency_to`, `rate`) VALUES ("EUR", "PLN", 1.0);'
6469
magerun2 db:query 'INSERT INTO `directory_currency_rate` (`currency_from`, `currency_to`, `rate`) VALUES ("EUR", "CHF", 1.0);'
70+
magerun2 db:query 'INSERT INTO `directory_currency_rate` (`currency_from`, `currency_to`, `rate`) VALUES ("EUR", "SEK", 1.0);'
6571

6672
if grep -q Magento_TwoFactorAuth "app/etc/config.php"; then
6773
./retry "php bin/magento module:disable Magento_TwoFactorAuth -f"

.github/workflows/templates/magento/merge-config.php.stub

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ $magentoConfig['scopes'] = [
8080
'name' => 'Poland',
8181
'sort_order' => '2',
8282
'is_active' => '1'
83+
],
84+
'it' => [
85+
'store_id' => '4',
86+
'code' => 'it',
87+
'website_id' => '1',
88+
'group_id' => '1',
89+
'name' => 'Italy',
90+
'sort_order' => '3',
91+
'is_active' => '1'
92+
],
93+
'se' => [
94+
'store_id' => '5',
95+
'code' => 'se',
96+
'website_id' => '1',
97+
'group_id' => '1',
98+
'name' => 'Sweden',
99+
'sort_order' => '3',
100+
'is_active' => '1'
83101
]
84102
]
85103
];

.github/workflows/unit-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [push, pull_request]
44
jobs:
55
build:
66
strategy:
7+
fail-fast: false
78
matrix:
89
include:
910
- PHP_VERSION: php73-fpm
@@ -18,7 +19,7 @@ jobs:
1819
MAGENTO_VERSION: 2.4.7
1920
runs-on: ubuntu-latest
2021
steps:
21-
- uses: actions/checkout@v1
22+
- uses: actions/checkout@v4
2223

2324
- name: Start Docker
2425
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}
@@ -30,7 +31,7 @@ jobs:
3031
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev
3132

3233
- name: Activate the extension
33-
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated && php bin/magento setup:di:compile"
34+
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade && php bin/magento setup:di:compile"
3435

3536
- name: Run tests
3637
run: docker exec magento-project-community-edition bash -c "vendor/bin/phpunit extensions/*/Test/Unit"

Model/Client/Payments.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,10 @@ public function startTransaction(OrderInterface $order, $mollieApi)
233233
}
234234

235235
if ($method == 'banktransfer') {
236-
$paymentData['billingAddress']['email'] = $order->getCustomerEmail();
237236
$paymentData['dueDate'] = $this->mollieHelper->getBanktransferDueDate($storeId);
238237
}
239238

240-
if ($method == 'przelewy24') {
239+
if (in_array($method, ['przelewy24', 'trustly', 'banktransfer'])) {
241240
$paymentData['billingAddress']['email'] = $order->getCustomerEmail();
242241
}
243242

Model/Methods/Swish.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/*
3+
* Copyright Magmodules.eu. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Mollie\Payment\Model\Methods;
8+
9+
use Mollie\Payment\Model\Mollie;
10+
11+
/**
12+
* Class Swish
13+
*
14+
* @package Mollie\Payment\Model\Methods
15+
*/
16+
class Swish extends Mollie
17+
{
18+
/**
19+
* Payment method code
20+
*
21+
* @var string
22+
*/
23+
const CODE = 'mollie_methods_swish';
24+
}

Observer/SalesModelServiceQuoteSubmitSuccess/StartTransactionForPointOfSaleOrders.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Mollie requires no minimum costs, no fixed contracts, no hidden costs. At Mollie
5454
- Satispay
5555
- SEPA Direct Debit
5656
- SOFORT Banking
57+
- Swish
5758
- Trustly
5859
- TWINT
5960

Service/Mollie/PaymentMethods.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class PaymentMethods
4747
'mollie_methods_riverty',
4848
'mollie_methods_satispay',
4949
'mollie_methods_sofort',
50+
'mollie_methods_swish',
5051
'mollie_methods_trustly',
5152
'mollie_methods_twint',
5253
'mollie_methods_voucher',

Test/End-2-end/cypress.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright Magmodules.eu. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
16
const { defineConfig } = require("cypress");
27

38
const defaultProductId = process.env.DEFAULT_PRODUCT_ID || 2;
@@ -80,6 +85,14 @@ module.exports = defineConfig({
8085
return data.code
8186
})
8287

88+
// Region ID is expected to be a select, but in Magento 2.3.7-p4 it is an input
89+
if (process.env.MAGENTO_VERSION === '2.3.7-p4') {
90+
methods.splice(methods.indexOf('swish'), 1);
91+
92+
console.log('Detected Magento 2.3.7-p4, removing Swish from the list of available methods');
93+
}
94+
95+
8396
config.env.mollie_available_methods = methods;
8497

8598
console.log('Available Mollie payment methods: ', methods);

Test/End-2-end/cypress/e2e/magento/methods/riverty.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const cartPage = new CartPage();
2020
if (Cypress.env('mollie_available_methods').includes('riverty')) {
2121
describe('Check that riverty behaves as expected', () => {
2222
[
23-
{status: 'paid', orderStatus: 'Processing', title: 'C3303025: Validate the submission of an order with Riverty as payment method and payment mark as "Paid"'},
23+
{status: 'authorized', orderStatus: 'Processing', title: 'C3303025: Validate the submission of an order with Riverty as payment method and payment mark as "Paid"'},
2424
{status: 'failed', orderStatus: 'Canceled', title: 'C3303026: Validate the submission of an order with Riverty as payment method and payment mark as "Failed"'},
2525
{status: 'expired', orderStatus: 'Canceled', title: 'C3303027: Validate the submission of an order with Riverty as payment method and payment mark as "Expired"'},
2626
{status: 'canceled', orderStatus: 'Canceled', title: 'C3303028: Validate the submission of an order with Riverty as payment method and payment mark as "Canceled"'},
@@ -35,7 +35,7 @@ if (Cypress.env('mollie_available_methods').includes('riverty')) {
3535

3636
mollieHostedPaymentPage.selectStatus(testCase.status);
3737

38-
if (testCase.status === 'paid') {
38+
if (testCase.status === 'authorized') {
3939
checkoutSuccessPage.assertThatOrderSuccessPageIsShown();
4040
}
4141

0 commit comments

Comments
 (0)