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

Release 3.14.1 #422

Merged
merged 5 commits into from
Sep 29, 2023
Merged
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
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "3.14.0",
"version": "3.14.1",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
"shopware/core": "^6.4.0.0",
"shopware/storefront": "^6.4.0.0",
"shopware/core": "^6.4.0.0 || ^6.5.0.0",
"shopware/storefront": "^6.4.0.0 || ^6.5.0.0",
"adyen/php-api-library": "15.0.0",
"adyen/php-webhook-module": "0.8.0",
"monolog/monolog": "^1.16 || ^2.0 || ^3.0",
"ext-json": "*"
},
"extra": {
Expand Down
45 changes: 45 additions & 0 deletions src/AdyenPaymentShopware6.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,56 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Doctrine\DBAL\Connection;
use Shopware\Core\System\SalesChannel\SalesChannelEntity;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class AdyenPaymentShopware6 extends Plugin
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$this->installJsAssets($container->getParameter('kernel.shopware_version'));
}

public function installJsAssets($shopwareVersion)
{
$storefrontAssetPath = __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware6.js';
$adminAssetPath = __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware6.js';
if (\version_compare($shopwareVersion, '6.5.0.0', '<')) {
$resultStorefront = copy(
__DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware64.js.dist',
$storefrontAssetPath
);
$resultAdmin = copy(
__DIR__ . '/Resources/public/administration/js/adyen-payment-shopware64.js.dist',
$adminAssetPath
);
} else {
$resultStorefront = copy(
__DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware65.js.dist',
$storefrontAssetPath
);
$resultAdmin = copy(
__DIR__ . '/Resources/public/administration/js/adyen-payment-shopware64.js.dist',
$adminAssetPath
);
}

if (!$resultStorefront) {
// @todo: add notice:
// Unable to install your storefront javascript assets, please run the command `bin/build-storefront.sh`
// from your Shopware web directory
}

if (!$resultAdmin) {
// @todo: add notice:
// Unable to install your admin javascript assets, please run the command `bin/build-administration.sh`
// from your Shopware web directory
}
}

public function install(InstallContext $installContext): void
{
$this->installJsAssets($installContext->getCurrentShopwareVersion());
foreach (PaymentMethods\PaymentMethods::PAYMENT_METHODS as $paymentMethod) {
$this->addPaymentMethod(new $paymentMethod(), $installContext->getContext());
}
Expand Down Expand Up @@ -92,6 +136,7 @@ public function uninstall(UninstallContext $uninstallContext): void

public function update(UpdateContext $updateContext): void
{
$this->installJsAssets($updateContext->getCurrentShopwareVersion());
$currentVersion = $updateContext->getCurrentPluginVersion();

if (\version_compare($currentVersion, '1.2.0', '<')) {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/Service/ConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ class ConfigurationService
private $systemConfigService;

/**
* @var EntityRepository
* @var EntityRepository|\Shopware\Core\Content\Media\DataAbstractionLayer\MediaRepositoryDecorator
*/
private $mediaRepository;

/**
* ConfigurationService constructor.
*
* @param SystemConfigService $systemConfigService
* @param EntityRepository $mediaRepository
* @param mixed $mediaRepository
* @note `media.repository` service is decorated in Shopware 6.4 and does not return EntityRepository object
*/
public function __construct(
SystemConfigService $systemConfigService,
EntityRepository $mediaRepository
$mediaRepository
) {
$this->systemConfigService = $systemConfigService;
$this->mediaRepository = $mediaRepository;
Expand Down
Loading