Skip to content

Commit 0ef2e56

Browse files
Merge pull request #569 from mollie/release/2.17.0
Release/2.17.0
2 parents b0481ce + bd0655a commit 0ef2e56

File tree

20 files changed

+344
-73
lines changed

20 files changed

+344
-73
lines changed

.github/workflows/codeql.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '16 9 * * 2'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2

.github/workflows/integration-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ jobs:
66
strategy:
77
matrix:
88
include:
9-
- PHP_VERSION: php71-fpm
10-
MAGENTO_VERSION: 2.3.3
119
- PHP_VERSION: php73-fpm
1210
MAGENTO_VERSION: 2.3.7-p3
1311
- PHP_VERSION: php73-fpm

.github/workflows/linting.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@ name: Lint PHP files
22
on: [push, pull_request]
33

44
jobs:
5-
php-70:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: StephaneBour/actions-php-lint@7.0
9-
with:
10-
dir: './'
11-
12-
php-71:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: StephaneBour/actions-php-lint@7.1
16-
with:
17-
dir: './'
18-
195
php-72:
206
runs-on: ubuntu-latest
217
steps:
@@ -36,3 +22,10 @@ jobs:
3622
- uses: StephaneBour/actions-php-lint@7.4
3723
with:
3824
dir: './'
25+
26+
php-81:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: StephaneBour/actions-php-lint@8.1
30+
with:
31+
dir: './'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ jobs:
66
strategy:
77
matrix:
88
include:
9-
- PHP_VERSION: php71-fpm
10-
MAGENTO_VERSION: 2.3.3
119
- PHP_VERSION: php73-fpm
1210
MAGENTO_VERSION: 2.3.7-p3
1311
- PHP_VERSION: php74-fpm
1412
MAGENTO_VERSION: 2.4.2
1513
- PHP_VERSION: php74-fpm
1614
MAGENTO_VERSION: 2.4.3-with-replacements
15+
- PHP_VERSION: php81-fpm
16+
MAGENTO_VERSION: 2.4.4
1717

1818
runs-on: ubuntu-latest
1919
steps:

.github/workflows/unit-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ jobs:
66
strategy:
77
matrix:
88
include:
9-
- PHP_VERSION: php71-fpm
10-
MAGENTO_VERSION: 2.3.3
119
- PHP_VERSION: php73-fpm
1210
MAGENTO_VERSION: 2.3.7-p3
1311
- PHP_VERSION: php74-fpm

Config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,22 @@ public function getVersion()
155155

156156
/**
157157
* Returns current version of Magento
158+
*
159+
* @return string
158160
*/
159161
public function getMagentoVersion(): string
160162
{
161163
return $this->productMetadata->getVersion();
162164
}
163165

166+
/**
167+
* @return string
168+
*/
169+
public function getMagentoEdition(): string
170+
{
171+
return $this->productMetadata->getEdition();
172+
}
173+
164174
/**
165175
* Returns API key
166176
*

Controller/Checkout/Webhook.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,13 @@ public function execute()
7070

7171
$transactionId = $this->getRequest()->getParam('id');
7272
if (!$transactionId) {
73-
return $this->getErrorResponse(404, __('No transaction ID found')->render());
73+
return $this->getOkResponse();
7474
}
7575

7676
try {
7777
$orderIds = $this->mollieModel->getOrderIdsByTransactionId($transactionId);
7878
if (!$orderIds) {
79-
return $this->getErrorResponse(
80-
404,
81-
__('There is no order found that belongs to "%1"', $transactionId)->render()
82-
);
79+
return $this->getOkResponse();
8380
}
8481

8582
foreach ($orderIds as $orderId) {
@@ -90,7 +87,7 @@ public function execute()
9087
} catch (\Exception $e) {
9188
$this->mollieHelper->addTolog('error', $e->getMessage());
9289

93-
return $this->getErrorResponse(503);
90+
return $this->getErrorResponse(200);
9491
}
9592
}
9693

GraphQL/Resolver/Checkout/ProcessTransaction.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ private function getCart(string $status, string $cartId): ?array
8484
PaymentStatus::STATUS_EXPIRED,
8585
PaymentStatus::STATUS_CANCELED,
8686
PaymentStatus::STATUS_FAILED,
87-
PaymentStatus::STATUS_PENDING,
8887
]);
8988

9089
try {

Model/Api.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function __construct(
3838
public function load($storeId = null)
3939
{
4040
$this->setApiKey($this->mollieHelper->getApiKey($storeId));
41-
$this->addVersionString('Magento/' . $this->mollieHelper->getMagentoVersion());
41+
$this->addVersionString('Magento/' . $this->config->getMagentoVersion());
42+
$this->addVersionString('MagentoEdition/' . $this->config->getMagentoEdition());
4243
$this->addVersionString('MollieMagento2/' . $this->mollieHelper->getExtensionVersion());
4344
}
4445
}

Model/Client/Orders.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Mollie\Api\Resources\Order as MollieOrder;
2626
use Mollie\Api\Resources\Payment;
2727
use Mollie\Api\Types\OrderStatus;
28+
use Mollie\Payment\Config;
2829
use Mollie\Payment\Helper\General as MollieHelper;
2930
use Mollie\Payment\Model\Adminhtml\Source\InvoiceMoment;
3031
use Mollie\Payment\Model\Client\Orders\ProcessTransaction;
@@ -129,6 +130,11 @@ class Orders extends AbstractModel
129130
*/
130131
private $processTransaction;
131132

133+
/**
134+
* @var Config
135+
*/
136+
private $config;
137+
132138
/**
133139
* Orders constructor.
134140
*
@@ -171,6 +177,7 @@ public function __construct(
171177
BuildTransaction $buildTransaction,
172178
PaymentTokenForOrder $paymentTokenForOrder,
173179
ProcessTransaction $processTransaction,
180+
Config $config,
174181
EventManager $eventManager
175182
) {
176183
$this->orderLines = $orderLines;
@@ -192,6 +199,7 @@ public function __construct(
192199
$this->eventManager = $eventManager;
193200
$this->paymentTokenForOrder = $paymentTokenForOrder;
194201
$this->processTransaction = $processTransaction;
202+
$this->config = $config;
195203
}
196204

197205
/**
@@ -433,7 +441,8 @@ public function loadMollieApi($apiKey)
433441
if (class_exists('Mollie\Api\MollieApiClient')) {
434442
$mollieApiClient = new MollieApiClient();
435443
$mollieApiClient->setApiKey($apiKey);
436-
$mollieApiClient->addVersionString('Magento/' . $this->mollieHelper->getMagentoVersion());
444+
$mollieApiClient->addVersionString('Magento/' . $this->config->getMagentoVersion());
445+
$mollieApiClient->addVersionString('MagentoEdition/' . $this->config->getMagentoEdition());
437446
$mollieApiClient->addVersionString('MollieMagento2/' . $this->mollieHelper->getExtensionVersion());
438447
return $mollieApiClient;
439448
} else {

0 commit comments

Comments
 (0)