-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from JanPalen/feature/OP-446-upgrade-plugin-to-…
…sylius-1.13-support Upgrade plugin to Sylius 1.13 compatibility
- Loading branch information
Showing
66 changed files
with
429 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
name: Build | ||
|
||
on: | ||
push: ~ | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: ~ | ||
release: | ||
types: [created] | ||
types: [ created ] | ||
schedule: | ||
- cron: "0 1 * * 6" | ||
workflow_dispatch: ~ | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}" | ||
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.0] | ||
sylius: [~1.10.0, ~1.11.0] | ||
node: [12.x] | ||
mysql: [5.7, 8.0] | ||
php: [ "8.0", "8.1", "8.2", "8.3" ] | ||
symfony: [ "^5.4", "^6.4" ] | ||
sylius: [ "~1.12.0", "~1.13.0" ] | ||
node: [ "^18.0", "^20.0" ] | ||
mysql: ["8.0"] | ||
|
||
exclude: | ||
- # Segmentation fault while clearing cache | ||
php: 8.0 | ||
mysql: 5.7 | ||
- | ||
sylius: ~1.9.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.11.0 | ||
php: 7.4 | ||
- sylius: "~1.13.0" | ||
php: "8.0" | ||
- symfony: "^6.4" | ||
php: "8.0" | ||
|
||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}" | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Setup PHP | ||
|
@@ -51,7 +52,7 @@ jobs: | |
|
||
- | ||
name: Setup Node | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "${{ matrix.node }}" | ||
|
||
|
@@ -106,7 +107,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 | ||
|
@@ -128,8 +129,8 @@ jobs: | |
- | ||
name: Prepare test application assets | ||
run: | | ||
(cd tests/Application && yarn encore dev) | ||
(cd tests/Application && bin/console assets:install public -vvv) | ||
(cd tests/Application && yarn build) | ||
- | ||
name: Prepare test application cache | ||
run: (cd tests/Application && bin/console cache:warmup -vvv) | ||
|
@@ -154,7 +155,7 @@ jobs: | |
name: Run Behat | ||
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun | ||
|
||
- | ||
- | ||
name: Failed build Slack notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
<?php | ||
|
||
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 { | ||
putenv('ALLOW_BITBAG_OS_HEADER=1'); | ||
|
||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]); | ||
$config->import('vendor/bitbag/coding-standard/ecs.php'); | ||
$config->paths(['src', 'tests']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
@@ -25,7 +26,6 @@ | |
final class CaptureAction implements ActionInterface, ApiAwareInterface, GatewayAwareInterface | ||
{ | ||
use GatewayAwareTrait; | ||
|
||
use ApiAwareTrait; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
@@ -26,7 +27,6 @@ | |
final class StatusAction implements ActionInterface, GatewayAwareInterface, ApiAwareInterface | ||
{ | ||
use GatewayAwareTrait; | ||
|
||
use ApiAwareTrait; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
|
@@ -14,35 +15,27 @@ | |
|
||
class QuadPayApiClient implements QuadPayApiClientInterface | ||
{ | ||
/** @var ClientInterface */ | ||
protected $apiClient; | ||
protected string $clientId; | ||
|
||
/** @var string */ | ||
protected $clientId; | ||
protected string $clientSecret; | ||
|
||
/** @var string */ | ||
protected $clientSecret; | ||
protected string $apiEndpoint; | ||
|
||
/** @var string */ | ||
protected $apiEndpoint; | ||
protected string $authTokenEndpoint; | ||
|
||
/** @var string */ | ||
protected $authTokenEndpoint; | ||
protected string $apiAudience; | ||
|
||
/** @var string */ | ||
protected $apiAudience; | ||
|
||
public function __construct(ClientInterface $client) | ||
{ | ||
$this->apiClient = $client; | ||
public function __construct( | ||
protected ClientInterface $client, | ||
) { | ||
} | ||
|
||
public function setConfig( | ||
string $clientId, | ||
string $clientSecret, | ||
string $apiEndpoint, | ||
string $authTokenEndpoint, | ||
string $apiAudience | ||
string $apiAudience, | ||
): void { | ||
$this->clientId = $clientId; | ||
$this->clientSecret = $clientSecret; | ||
|
@@ -105,7 +98,7 @@ public function refund( | |
float $amount, | ||
string $merchantRefundReference, | ||
string $orderToken, | ||
?string $orderId = null | ||
?string $orderId = null, | ||
): array { | ||
if (null === $orderId) { | ||
$orderId = $this->getOrderByToken($orderToken)['orderId']; | ||
|
@@ -136,14 +129,14 @@ protected function request( | |
string $method, | ||
string $url, | ||
array $data = [], | ||
?string $accessToken = null | ||
?string $accessToken = null, | ||
): array { | ||
$options = [ | ||
'json' => $data, | ||
'headers' => $this->getHeaders($accessToken), | ||
]; | ||
|
||
$result = $this->apiClient->request($method, $url, $options); | ||
$result = $this->client->request($method, $url, $options); | ||
|
||
return \GuzzleHttp\json_decode((string) $result->getBody(), true); | ||
} | ||
|
Oops, something went wrong.