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

Upgrade plugin to Sylius 1.13 compatibility #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 18 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@ on:

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"

strategy:
fail-fast: false
matrix:
php: [8.0]
symfony: [^4.4, ^5.2]
sylius: [~1.11]
node: [14.x]
mysql: [8.0]
php: [ "8.0", "8.1", "8.2", "8.3" ]
symfony: [ "^5.4", "^6.4" ]
sylius: [ "~1.12.0", "~1.13.0" ]
node: [ "^20.0" ]
mysql: [ "8.0" ]

exclude:
- sylius: ~1.9
php: 8.0
- sylius: ~1.10
symfony: 4.4
- sylius: ~1.11
php: 7.4
- sylius: "~1.13.0"
php: "8.0"
- symfony: "^6.4"
php: "8.0"


env:
Expand All @@ -39,7 +37,7 @@ jobs:

steps:
-
uses: actions/checkout@v2
uses: actions/checkout@v3

-
name: Setup PHP
Expand All @@ -52,7 +50,7 @@ jobs:

-
name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"

Expand Down Expand Up @@ -90,7 +88,7 @@ jobs:

-
name: Cache Composer
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
Expand All @@ -117,7 +115,7 @@ jobs:
-
name: Get Yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

-
name: Cache Yarn
Expand All @@ -142,8 +140,7 @@ jobs:
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn add slick-carousel)
(cd tests/Application && yarn build)
(cd tests/Application && yarn encore dev)

-
name: Prepare test application cache
Expand All @@ -163,7 +160,7 @@ jobs:

-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/
run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src/

-
name: Run ECS
Expand All @@ -185,8 +182,8 @@ jobs:
name: Behat logs
path: etc/build/
if-no-files-found: ignore
-

-
name: Failed build Slack notification
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
Expand Down
42 changes: 22 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"description": "MultiSafepay payment plugin for Sylius applications.",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"doctrine/annotations": "^1.13",
"friendsofphp/php-cs-fixer": "^3.3",
"php": "^8.0 || ^8.1",
"doctrine/annotations": "^2.0.0",
"multisafepay/api": "^2.0",
"php-http/message-factory": "^1.1",
"sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0"
"sylius/sylius": "~1.12.0 || ~1.13.0",
"symfony/webpack-encore-bundle": "^1.14"
},
"require-dev": {
"babdev/pagerfanta-bundle": "^2.5",
"babdev/pagerfanta-bundle": "^3.0",
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"bitbag/coding-standard": "^1.0",
"bitbag/coding-standard": "^3.0.0",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
Expand All @@ -26,24 +26,26 @@
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"lakion/mink-debug-extension": "^2.0.0",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.88",
"phpstan/phpstan-doctrine": "0.12.37",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": ">=8.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sensiolabs/security-checker": "^6.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"symplify/easy-coding-standard": "^9.4",
"vimeo/psalm": "4.24.0"
"symfony/browser-kit": "^5.4 || 6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symplify/easy-coding-standard": "^10.0 || ^11.0",
"vimeo/psalm": "~4.12 || ^5.0.0",
"psalm/plugin-symfony": "~4.0 || ~5.0"
},
"conflict": {
"behat/mink-selenium2-driver": ">=1.7.0"
},
"config": {
"sort-packages": true,
Expand Down
15 changes: 6 additions & 9 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php');
return static function (ECSConfig $config): void {

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
__DIR__ . '/tests',
]);
putenv('ALLOW_BITBAG_OS_HEADER=1');

$config->import('vendor/bitbag/coding-standard/ecs.php');
$config->paths(['src', 'tests']);
};
9 changes: 5 additions & 4 deletions src/Action/Api/ApiAwareTrait.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Action/CaptureAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Action/ConvertPaymentAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/Action/NotifyAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down Expand Up @@ -33,7 +34,7 @@
use GatewayAwareTrait, ApiAwareTrait;

/** @var LoggerInterface */
private $logger;

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.1, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.0, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.1, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.2, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.2, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.2, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.1, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.3, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.3, Symfony ^5.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.3, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.1, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.2, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

Check failure on line 37 in src/Action/NotifyAction.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.13.0, PHP 8.3, Symfony ^6.4, MySQL 8.0

Property BitBag\SyliusMultiSafepayPlugin\Action\NotifyAction::$logger is never read, only written.

/** @var FactoryInterface */
private $stateMachineFactory;
Expand Down
10 changes: 5 additions & 5 deletions src/Action/StatusAction.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand All @@ -24,7 +25,6 @@
final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiAwareInterface
{
use GatewayAwareTrait;

use ApiAwareTrait;

public function execute($request): void
Expand Down
15 changes: 8 additions & 7 deletions src/ApiClient/MultiSafepayApiClient.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand All @@ -28,15 +29,15 @@ public function initialise(
string $apiKey,
string $type,
bool $sandbox = true,
bool $allowMultiCurrency = false
bool $allowMultiCurrency = false,
): void {
$this->type = $type;
$this->allowMultiCurrency = $allowMultiCurrency;

$this->client = new Client();
$this->client->setApiKey($apiKey);
$this->client->setApiUrl(
$sandbox ? self::API_URL_TEST : self::API_URL_LIVE
$sandbox ? self::API_URL_TEST : self::API_URL_LIVE,
);
}

Expand Down Expand Up @@ -65,7 +66,7 @@ public function getAllowMultiCurrency(): bool
public function refund(
string $orderId,
int $amount,
string $currencyCode
string $currencyCode,
): void {
$endpoint = sprintf('orders/%s/refunds', $orderId);

Expand Down
13 changes: 7 additions & 6 deletions src/ApiClient/MultiSafepayApiClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down Expand Up @@ -46,7 +47,7 @@ public function initialise(
string $apiKey,
string $type,
bool $sandbox = true,
bool $allowMultiCurrency = false
bool $allowMultiCurrency = false,
): void;

public function createPayment(array $data): Orders;
Expand All @@ -58,7 +59,7 @@ public function getType(): string;
public function refund(
string $orderId,
int $amount,
string $currencyCode
string $currencyCode,
): void;

public function isPaymentActive(string $status): bool;
Expand Down
9 changes: 5 additions & 4 deletions src/BitBagSyliusMultiSafepayPlugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
9 changes: 5 additions & 4 deletions src/DependencyInjection/BitBagSyliusMultiSafepayExtension.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

Expand Down
Loading
Loading